docker tomcat容器 mysql必须部署在docker上吗
发布网友
发布时间:2022-04-25 14:43
我来回答
共1个回答
热心网友
时间:2022-05-02 20:18
1 docker pull mysql
2 docker run -v /data/var/mysql/:/var/lib/mysql -e YSQL_ROOT_PASSWORD=kS4pJUIb mysql
3 docker stop [CONTAINER ID]
4 docker run -it -v /data/var/mysql/:/var/lib/mysql mysql /bin/bash
5 mysqld_safe&
6 grant all privileges on *.* to 'wuxiao'@'%' identified by 'password';
7 docker cp [CONTAINER ID]:/etc/mysql/my.cnf /data/local/my.cnf
8 docker stop [CONTAINER ID]