Managing MySQL
MySQL (or MariaDB) can be managed as root from the host operating system. There is no need to enter the MySQL or MariaDB container.
To access MySQL as root, just run mysql
. The
credentials are stored in /root/.my.cnf
and
will be automatically loaded. The connection will be made 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 since the appcd
service will
use these credentials to connect to MySQL.
# Common commands
See a full list of running SQL queries
mysql -e 'show full processlist'
Kill a running SQL query
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