Tokaido Containers
MySQL
Tokaido includes a MySQL container for serving your Drupal database. This isn't anything special we've created, but rather it's the official MySQL Docker image.
Info
Tokaido uses MySQL 5.6, 5.7, or 8.0 and MariaDB 10.3, or 10.4The MySQL container uses a special Docker volume to persist your database across rebuilds of your Tokaido environment.
The MySQL credentials are as follows:
- Username:
tokaido
- Password:
tokaido
- Hostname:
mysql
- Database Name:
tokaido
If you want to log in to the database as root, just change the username to root. All other details - including the password - remain the same.
Accessing your Database inside Tokaido
The hostname or IP address of the MySQL database will differ depending on whether or not you are accessing it from inside or outside of the Tokaido environment.
For example, inside Tokaido the database is available at mysql:3306. Specifically, Drupal will use this database hostname.
You can most easily access the database from inside Tokaido by using either drush sql-cli
ormysql -u tokaido mysql -p
Accessing your Database from your Host Machine
If you want to access the MySQL database from your local system, you need to identify the MySQL Port. This port is dynamic and changes each time you run tok up
You can configure database container to always use a specific port for a project by running tok config-set global project database port XXXX
where XXXX is a port number between 1024 and 65535.
Tokaido provides a the handy tok ports
command to quickly look up the port of any exposed Tokaido service.
From your host, run tok ports mysql to get the MySQL dynamic port number
tok ports mysql
Now you can use that You can log in as root by using the same password (tokaido
).