Databases

Host MySQL on VeloxaHost

MySQL is the widely used relational database behind WordPress, Laravel, Rails and countless PHP and Node.js applications. Developers run their own MySQL server when they want control over the version, configuration and where the data lives, at a fraction of a managed database's price.

The one-click install uses Ubuntu 24.04's own mysql-server package, which is MySQL 8.0, and sets a generated password for root@localhost, shown on the server's page in the console. MySQL listens on 127.0.0.1 only, so nothing is exposed until you choose to.

The MySQL reference manual is the place for configuration and SQL details.

What it needs, and the setting that matters

MySQL itself starts small, but its main cache does not grow on its own. The InnoDB buffer pool defaults to 128 MB, and MySQL's manual notes that on a dedicated database server up to 80% of memory is often given to it. After you size the server, set it in /etc/mysql/mysql.conf.d/mysqld.cnf:

[mysqld]
innodb_buffer_pool_size = 1G

and restart with systemctl restart mysql. On a 2 GB server, 1 GB leaves room for connections and the operating system.

The catalogue's minimum is 1 vCPU and 512 MB, fine for development. The recommended 1 vCPU and 2 GB fits the Veloxa 1 size: 1 vCPU, 2 GB RAM and 50 GB of disk for $8 a month, billed at $0.02 an hour and capped at the monthly price. For a production database with a working set of several gigabytes, Veloxa 2 (2 vCPU, 4 GB, $15) or Veloxa 4 (4 vCPU, 8 GB, $30) keeps it in memory.

Connecting from your application

If the application runs on the same server, connect to localhost. For a remote application:

  1. Create a user for the application's address, in the browser terminal on the server's page.
    CREATE USER 'app'@'203.0.113.10' IDENTIFIED BY 'a-long-password';
    CREATE DATABASE appdb;
    GRANT ALL ON appdb.* TO 'app'@'203.0.113.10';
    
  2. Set bind-address = 0.0.0.0 in mysqld.cnf and restart MySQL.
  3. Every server gets a block of ports on the region's shared IPv4 address. Under How to connect, forward a port of the block to 3306, and connect with the shared address and that port. A dedicated IPv4 address (a paid add-on with limited availability) serves 3306 directly.
  4. Attach a VeloxaHost firewall that allows the MySQL port only from your application's addresses. Private networks are not available in US East yet, so this traffic crosses the public network; require TLS for the user with ALTER USER ... REQUIRE SSL.

Backups and updates

Turn on automatic snapshots on the server page (hourly up to weekly, kept for 1 to 30 days) and scheduled backups (every 6 hours up to weekly, keeping 1 to 10). A snapshot is crash-consistent: InnoDB recovers from it like after a power cut. Also keep logical dumps, which restore one database at a time and move between versions:

mysqldump --single-transaction --routines --triggers --databases appdb > appdb.sql

MySQL's manual notes mysqldump is not built for very large datasets; above tens of gigabytes, look at physical backups. Minor updates come from apt upgrade; take a snapshot first.

FAQ

Which MySQL version do I get, and is it still supported?

Ubuntu 24.04 ships MySQL 8.0, updated through Ubuntu's security and updates pockets. Oracle's own premier support for 8.0 ended in April 2026, and it recommends moving to the 8.4 LTS series. To run 8.4, install it from MySQL's APT repository on a fresh server and load your dumps.

How much RAM does MySQL need?

As much as your frequently used data, plus room for connections. 2 GB with a 1 GB buffer pool suits a typical small application. Memory can be raised from the console without a restart, but MySQL only uses it once you raise innodb_buffer_pool_size.

How do I move a database from Amazon RDS or another managed service?

Dump it with mysqldump --single-transaction --routines --triggers, copy the file over, and import it with mysql appdb < appdb.sql. Run the same or a newer MySQL version than the source.

Should I use MySQL or MariaDB?

Use whatever your application documents. MariaDB started as a MySQL fork and is mostly compatible, but the two have diverged, for example in JSON handling and replication. Both are one-click apps here.

What license is MySQL under?

MySQL Community Server is available under the GPL. Oracle also sells commercial editions with extra tools.

Which VeloxaHost size fits MySQL?

The recommended 1 vCPU and 2 GB of RAM is a Veloxa 1: 1 vCPU, 2 GB RAM and 50 GB of disk for $8 a month, billed at $0.02 an hour and capped at that price.