Cloud VPS from $1.98/mo · pay with Bitcoin, Ethereum, Monero, USDT or Solana · paid in crypto
DatabasesEditor's pick

MySQL on a VPS

MySQL Community Server is the open-source relational database behind WordPress, Drupal and many web stacks, with InnoDB transactions and built-in replication.

1 GBMinimum memory
Ubuntu 24.04 LTSBase image
3306/tcp, 33060/tcpPorts
GPL-2.0 (Community Server)License

About MySQL

MySQL is a relational database maintained by Oracle, with the Community Server under GPL-2.0. InnoDB gives it ACID transactions, row-level locking and crash recovery, and built-in replication copies data to other servers.

A dedicated database server keeps query load off your web nodes. Place it in the same CloudSat region as the app, admit only the app servers through the firewall, and take a snapshot before upgrades.

MySQL listens on port 3306, bound to localhost by Ubuntu's defaults. The root account authenticates through the Unix socket, so sudo mysql opens a shell without a password.

What you get with MySQL

  • InnoDB storage with ACID transactions
  • Source-replica and group replication
  • JSON columns and functions alongside SQL
  • Window functions and common table expressions
  • Drivers for every major language

MySQL use cases

  • Store data for WordPress, Drupal or a custom app
  • Split the database from the web tier
  • Keep a read replica in a second region

After you deploy MySQL

  1. With the server Running, connect over SSH as root and type mysql, which signs you in over the socket.
  2. Run mysql_secure_installation to drop anonymous users and the test database.
  3. Create one user per application, such as CREATE USER 'shop'@'%' IDENTIFIED BY '<password>';, and GRANT it rights on its own database alone.
  4. For remote clients, change bind-address in /etc/mysql/mysql.conf.d/mysqld.cnf and open 3306 to those IPs only in a CloudSat firewall.

MySQL ports

Open these in your firewall if you use one: 3306/tcp MySQL, 33060/tcp X Protocol (MySQL Shell).

MySQL FAQ

How do I log in as the MySQL root user?

On Ubuntu, root uses socket authentication: run sudo mysql on the server itself. Give applications their own password-based users instead of root.

Should I tune MySQL's memory?

Yes. On a server that only runs MySQL, set innodb_buffer_pool_size to roughly half to 70% of RAM, restart, and watch how often reads miss the pool.

Disclaimer. The MySQL project has no affiliation with CloudSat and does not endorse it. Names and logos belong to their owners and appear only to identify the software.

MySQL on your own server.
Ready in under 5 minutes.

Pick a region and a size; the console shows the address as soon as it is up.

Every server delivered in under 5 minutesPay with crypto14-day money-back