How to login to MySQL Command-line EasyEngine

EasyEngine 4, since MariaDB / MySQL in EasyEngine is installed in the docker image, we have to run the docker-compose command to access the MySQL Command-line. To login MySQL with root account, use this command.

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

If above command not work, try to change global-db with ee-global-db.

Output window MariaDB / MySQL monitor:

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)

Now we can run MySQL command-line. for example try type show databases; then press Enter.

Done, and have fun.

Leave a Comment