Arama Yap Mesaj Submit
Request a Callback
+90
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro
X
X

Select Your Currency

Turkish Lira $ US Dollar Euro

Contact Us

Location Halkali merkez neighborhood fatih st ozgur apt no 46 , Kucukcekmece , Istanbul , 34303 , TR
Last technical review · 17.08.2026 · Ubuntu 26.04 + MySQL 8.4

Ubuntu 26.04 + MySQL 8.4 LTS: Beyond `apt install mysql-server`

Ubuntu 26.04 ships the MySQL 8.4 series. A production deployment is more than package installation: bind address, account model, backup validation, storage behavior and slow-query visibility belong together.

Production note

Question whether the database port must be public at all. Binding MySQL to 0.0.0.0:3306 for convenience unnecessarily expands attack surface.

ubuntu 26.04 mysql 8.4mysql 8.4 lts setupmysql security ubuntu
TECHNICAL IMPLEMENTATION PROFILE
EKA CORE
Ubuntu 26.04 + MySQL 8.4

If the application runs on the same VPS, keep MySQL bound locally by default. For remote access, prefer private networking/VPN or source-IP allow-lists over exposing 3306 globally, and use a dedicated least-privilege DB account.

8.4.xUbuntu 26.04 series
Checked
127.0.0.1Preferred default
Checked
3306/tcpMySQL port
Checked
Restore > BackupBackup rule
Checked
Technical guide · production-focused · official sources
Quick answer

If the application runs on the same VPS, keep MySQL bound locally by default. For remote access, prefer private networking/VPN or source-IP allow-lists over exposing 3306 globally, and use a dedicated least-privilege DB account.

01

Technical scope at a glance

Install MySQL 8.4 on Ubuntu 26.04 with production-focused bind rules, user privileges, TLS, firewalling, backups, slow-query logging and InnoDB sizing.

8.4.xUbuntu 26.04 series

Ubuntu resolute packages provide the MySQL 8.4 series; the exact security/update build changes over time.

127.0.0.1Preferred default

For same-host applications, localhost-only listening provides a smaller attack surface.

3306/tcpMySQL port

Open only when remote access is required and restrict by source address.

Restore > BackupBackup rule

A backup is successful only when it can be restored into a clean instance.

On this page

  1. 1. Install MySQL 8.4 from Ubuntu packages
  2. 2. Never use the root account for the application
  3. 3. Bind address and firewall solve different problems
  4. 4. Logical backup and restore test
  5. 5. Set a threshold before enabling the slow query log
  6. 6. Do not blindly set InnoDB buffer pool to “80% of RAM”
  7. Frequently asked questions
02

1. Install MySQL 8.4 from Ubuntu packages

Inspect repository origin and candidate version before installing on production.

Command
sudo apt update
Command
apt-cache policy mysql-server
Command
sudo apt install mysql-server -y
Command
mysql --version
Command
systemctl status mysql --no-pager
03

2. Never use the root account for the application

The application account should receive only required privileges on its own schema. Global `ALL PRIVILEGES` is usually unnecessary.

If migrations do not run from the runtime account, remove CREATE/ALTER too. Separate runtime and migration identities when possible.
Socket-based local administration for `root@localhost` is more controlled than enabling remote root password access.
Command
sudo mysql -e "CREATE DATABASE uygulama CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;"
Command
sudo mysql -e "CREATE USER 'uygulama'@'localhost' IDENTIFIED BY 'GUCLU_PAROLA';"
Command
sudo mysql -e "GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,ALTER,INDEX ON uygulama.* TO 'uygulama'@'localhost'; FLUSH PRIVILEGES;"
Command
sudo mysql -e "SHOW GRANTS FOR 'uygulama'@'localhost';"
04

3. Bind address and firewall solve different problems

The interface MySQL listens on and the sources allowed by the firewall are separate layers. Verify both.

ScenarioBindFirewall
Web + DB on same VPS127.0.0.13306 closed externally
Separate DB on private LANPrivate IPApp subnet/IP only
Temporary remote adminPrefer private IPVPN or one source IP
Command
sudo ss -lntp | grep 3306
Command
sudo mysql -e "SHOW VARIABLES LIKE 'bind_address';"
Command
sudo ufw status numbered
05

4. Logical backup and restore test

For small and medium databases, `mysqldump` is a clear baseline; large deployments may need physical backup, replicas or snapshots.

Command
mysqldump --single-transaction --routines --triggers uygulama | gzip > uygulama-$(date +%F).sql.gz
Command
mysql -e "CREATE DATABASE restore_test CHARACTER SET utf8mb4;"
Command
gunzip -c uygulama-YYYY-MM-DD.sql.gz | mysql restore_test
Command
mysql -e "SELECT table_schema,COUNT(*) tables_count FROM information_schema.tables WHERE table_schema IN ('uygulama','restore_test') GROUP BY table_schema;"
06

5. Set a threshold before enabling the slow query log

The goal is to capture queries that contribute to user latency, not dump every query to disk. Consider log growth and sensitive SQL content.

After identifying a slow query, move to `EXPLAIN ANALYZE` and indexing; more RAM does not replace query design.
Without retention/rotation, slow logs can fill storage. Add logrotate or centralized logging.
Command
sudo mysql -e "SHOW VARIABLES WHERE Variable_name IN ('slow_query_log','long_query_time','log_output');"
Command
sudo mysql -e "SET GLOBAL long_query_time=1.0; SET GLOBAL slow_query_log=ON;"
Command
sudo tail -f /var/log/mysql/mysql-slow.log
07

6. Do not blindly set InnoDB buffer pool to “80% of RAM”

If PHP, web server, Redis or workers share the VPS, MySQL cannot own all memory. Measure actual process usage first.

Command
free -h
Command
ps -eo pid,comm,%mem,rss --sort=-rss | head -20
Command
sudo mysql -e "SHOW VARIABLES LIKE 'innodb_buffer_pool_size';"
Command
sudo mysql -e "SHOW GLOBAL STATUS LIKE 'Threads_connected';"
EKA SUNUCU · TECHNICAL

Size storage IOPS and backup policy along with RAM for MySQL

“8 GB VPS” alone is not a database sizing strategy. Choose Eka Sunucu VPS/VDS based on active data set, concurrency, query mix and storage latency.

Production principleMeasure → Test → DeployNo fabricated benchmark data.
SRC

Official sources

Primary documentation and technical references used by this guide.

EKA

Related technical guides

Continue with related infrastructure and implementation guides.

FAQ

Frequently asked questions

Ubuntu 26.04 + MySQL 8.4

Does Ubuntu 26.04 provide MySQL 8.4?

Yes. Ubuntu resolute provides the MySQL 8.4 series. The exact update build changes over time; inspect it with `apt-cache policy mysql-server`.

Is mysql_secure_installation mandatory?

No. You can apply the underlying account and test-database controls manually. What matters is the resulting security state.

Can Cloudflare proxy MySQL port 3306?

Standard web proxying is not designed for this. Prefer VPN, private networking, SSH tunnels or an appropriate TCP proxy product.

How often should MySQL be backed up?

Your acceptable data-loss window (RPO) determines frequency. An order system may need daily full backups plus binlogs or a tighter strategy.

Top