You can use an SSH tunnel to connect to database from an external app (for example MySQL Workbench, HeidiSQL or PHPStorm)
- Uncomment ports directive in database service in
docker-compose.yml
ports:
- 127.0.0.1:${SSH_TUNNEL_EXT_PORT}:3306
-
Edit the
.env.mainfile, findSSH_TUNNEL_EXT_PORT- make sure that the port is unique. If you are using multiple instances, change the port value. -
Open your database management app and configure SSH tunnel, database connection
To use phpMyadmin need to run the phpMyadmin container first. It's not running by default.
-
Edit the
.env.mainfile, findPMA_EXT_PORT- make sure that the port is unique. If you are using multiple instances, change the port value. -
Run phpMyadmin container:
make pma- Open the
your-app-domain.com:PMA_EXT_PORTURL in the browser to access phpMyadmin. For example, we usePMA_EXT_PORT=8801. Openyour-app-domain.com:8801
- In
docker-compose.ymlfile uncommentcommand: --skip-grant-tablesin mariadb service - Restart containers:
make restart- Enter inside mariadb container:
make exec mariadb- Inside container run:
mariadb> FLUSH PRIVILEGES; ALTER USER 'root'@'%' IDENTIFIED BY 'new_password';Where 'new_password' - new root password
You can reset another database user password too - just change the username, host, and add new password.
For example, there are two root users in database - with % host and with localhost. Use this command to see all users:
SELECT User, Host FROM mysql.user;-
Revert back changes in
docker-compose.yml -
Restart containers:
make restart