docker pull mysql
docker run -p 3306:3306 --name mysql -e MYSQL_ROOT_PASSWORD=123456 -d mysql
docker exec -it mysql bash
cd /etc/mysql/mysql.conf.d/mysqld.cnf
docker cp mysql:/etc/mysql/mysql.conf.d/mysqld.cnf xxxx 挂在目录
docker run -d -p 3306:3306 --privileged=true -v /usr/local/docker/mysql/data:/var/lib/mysql -v /usr/local/docker/mysql/conf/my.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf -e MYSQL_ROOT_PASSWORD=123456 --name mysql mysql
Docker exec -it mysql bash
mysql -u root -p
### mysql 8 加密形式扭转 localhost
创立用户
alter user 'test'@'%' identified with mysql_native_password ;
// 设置明码
alter user 'test'@'%' identified with mysql_native_password by '1111';