How to find out the MySQL EasyEngine root password

On EasyEngine 4 and newer versions, all EasyEngine webserver applications, databases and PHP run in a Docker image container. So to be able to access it by command docker-compose.

Then, how find out the MySQL root password and login to the MySQL console? it’s easy, Just run the following command

cd /opt/easyengine/services && docker-compose exec global-db bash -c 'echo ${MYSQL_ROOT_PASSWORD}'Code language: PHP (php)

or with this command

grep 'MYSQL_ROOT_PASSWORD' /opt/easyengine/services/docker-compose.yml
Code language: JavaScript (javascript)

Output

- MYSQL_ROOT_PASSWORD=Nn40RGx5T6mF

The you can log in to the MySQL console by this command

cd /opt/easyengine/services && docker-compose exec global-db bash -c 'mysql -uroot -p${MYSQL_ROOT_PASSWORD}'Code language: PHP (php)

If successfully, you can see the MySQL or MariaDB monitor and now you can run the MySQL command-line.

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 15
Server version: 10.5.4-MariaDB-1:10.5.4+maria~focal-log mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
Code language: JavaScript (javascript)

Done.

Leave a Comment