Home > Back-end >  Use the docker start MySQL mirror failure
Use the docker start MySQL mirror failure

Time:09-22

Download MySQL5.7 mirror,
 
Docker run - itd - name mysql - p 3306:3306 - v/mydata/mysql/log:/var/log/mydata/mysql/data/mysql - v:/var/lib/mysql - v/mydata/mysql/conf:/etc/mysql - e MYSQL_ROOT_PASSWORD=123456 mysql

Use this command to start the MySQL service, after using the docker ps view and running, no container docker ps - l have a look at found with MySQL state is Exited, no matter how to restart all useless, baidu's approach did not solve, tried a card here all day today, mentality collapsed,,,

CodePudding user response:

After the interview with the -v/mydata/mysql/conf:/etc/mysql after the removing, found the container normal boot, but it means that the container configuration between the host and no map right?

And here there is a new problem: unable to log on to the MySQL
ERROR 1045 (28000) : Access denied for user 'root' @ 'localhost' (using password: YES)

Baidu said to change the configuration file, don't know how to use, plan to try again tomorrow, today is really disgusting vomit

CodePudding user response:

It seems only the/etc/mysql configuration file

CodePudding user response:

Slowly to

CodePudding user response:

First: docker containers use the host file system as a volume mount, and the network connection mode, etc., don't every time the run specified, good in yaml configuration, each time the docker - compsoer pull can
Second: docker ps - all find containerid you before failure, then the docker detailed log log can check before start failure
Finally: ERROR 1045 (28000) : Access denied for user 'root' @ 'localhost' (using password: YES) this is typical of mysql permission problems, have your mysql mirror that this is a free secret landing or have a initial password root account? In addition whether the image is ready to allow remote login? Or you can enter into the docker connection

Feel you on the docker virtual machine and mysql is not too familiar with the basic knowledge, suggest to learn the theoretical knowledge, start work again is not late, do technology as a scholar, don't rush

CodePudding user response:

Docker logs to check the container startup failure log analysis problem
  • Related