docker安装mysql

docker run --restart=always --name mysql5.7 -p 3306:3306  -v /home/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=mypassword123 -d mysql:latest --lower_case_table_names=1

 说明:

--lower_case_table_names=1   忽略大小写

问题1:

error 2059: Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

解决方法:

docker exec -it mysql /bin/bash
mysql -u root -p
show databases;
use mysql;
select user,host,plugin from user;
ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY 'mypassword123';
ALTER USER root IDENTIFIED WITH mysql_native_password BY 'mypassword123';
FLUSH PRIVILEGES;




 

posted @ 2019-10-16 10:17  SuperShen  阅读(175)  评论(0编辑  收藏  举报