Managing MySQL

MySQL (or MariaDB) can be managed as root from the host operating system. There is no need to enter the database container manually for standard administrative tasks.

To access MySQL as root, simply run mysql. The credentials are stored in /root/.my.cnf and will be automatically loaded. The connection is established over the Unix Domain Socket rather than TCP.

Changing the MySQL root password

Changing the MySQL root password will not cause any disruption provided you update /root/.my.cnf with the new password. The appcd service relies on these credentials to connect to the database engine.

Common Commands

See a full list of running SQL queries:

mysql -e 'show full processlist'

Kill a running SQL query (replace 1234 with the ID from processlist):

mysql -e 'kill 1234'

Enter the MySQL container directly:

docker exec -it mysql /bin/bash

Enter the MariaDB container directly:

docker exec -it mariadb /bin/bash