mysqldocker配置

编程

安装

  主机上的mysql服务是基于docker安装的,具体安装脚本如下:

docker run  --detach 

--restart always

--publish 3306:3306 --name mysql

--volume /data/mysql/logs:/logs

--volume /data/mysql/data:/mysql_data

-e MYSQL_ROOT_PASSWORD=123456

mysql:5.7.28

重启

docker restart mysql

关闭

docker stop mysql

卸载

docker rm mysql

访问

lwk@qwfys:~$ mysql -h cvm00.xtwj.com -u root -p

Enter password:

Welcome to the MySQL monitor. Commands end with ; or g.

Your MySQL connection id is 4

Server version: 5.7.28 MySQL Community Server (GPL)

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type "help;" or "h" for help. Type "c" to clear the current input statement.

mysql>

以上是 mysqldocker配置 的全部内容, 来源链接: utcz.com/z/510827.html

回到顶部