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
- With the server Running, connect over SSH as root and type
mysql, which signs you in over the socket. - Run
mysql_secure_installationto drop anonymous users and the test database. - Create one user per application, such as
CREATE USER 'shop'@'%' IDENTIFIED BY '<password>';, andGRANTit rights on its own database alone. - For remote clients, change
bind-addressin/etc/mysql/mysql.conf.d/mysqld.cnfand 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.