Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

parameter

meaning

-p 3307:3306

bind the container port 3306 to host port 3307

--name mysql-populated

the runtime name of the container, can be used instead of image id

-e

an environment variable to be passed into the container

mysql-db-populated:latest

the actual image name, can be found using docker images

Info

When you run the above script it fails with an error indicating that password authorisation is not supported. You need to change the MySQL plugin from auth_socket to mysql_native_password.

Follow these steps

For Docker

Check the IP address of the container that is hosting MySQL. Add this IP address to the MySQL users table for root user

...

Info

Be sure to give the user for the new IP the correct rights

...

Info

Now modify the privileges table

Code Block
languagesql
UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE User = 'root';
FLUSH PRIVILEGES;
Info

Be sure to restart the MySQL server