进入/Users/silver/dev/project/test/bindmouting/mysql目录

启动mysql
docker run —name wpmysql -v $(pwd)/conf:/etc/mysql/conf.d -v $(pwd)/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=wordpress -p 3306:3306 -d mysql

启动WordPress容器
docker run -d —link wpmysql:mysql -e WORDPRESS_DB_HOST=wpmysql:3306 —name mywordpress -p 8080:80 wordpress

问题

mysql8以上出现的问题

image.png

ALTER USER root IDENTIFIED WITH mysql_native_password BY ‘root’;
ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘root’;
````

select user,host,plugin from mysql.user;
image.png