docker 启动mysql
2021/12/18 19:22:39
本文主要是介绍docker 启动mysql,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
创建配置文件
[mysqld] pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock datadir = /var/lib/mysql log-error = /var/log/mysql/error.log symbolic-links = 0 default-time-zone = '+8:00' log_timestamps = system character-set-server= utf8mb4 collation-server = utf8mb4_unicode_ci log-bin = mysql-bin binlog_format = ROW max_binlog_size = 100M expire_logs_days = 0 server_id = 11
启动
docker run --rm --name some-mysql \ -v /etc/localtime:/etc/localtime:ro \ -v /root/mysql/conf:/etc/mysql/mysql.conf.d \ -v /root/mysql/data:/var/lib/mysql \ -p 3306:3306 \ -e MYSQL_ROOT_PASSWORD=my-secret-pw \ -e TZ=Asia/Shanghai \ -d mysql:5.7.36
这篇关于docker 启动mysql的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-11-15MySQL教程:初学者必备的MySQL数据库入门指南
- 2024-11-15MySQL教程:初学者必看的MySQL入门指南
- 2024-11-04部署MySQL集群项目实战:新手入门教程
- 2024-11-04如何部署MySQL集群资料:新手入门指南
- 2024-11-02MySQL集群项目实战:新手入门指南
- 2024-11-02初学者指南:部署MySQL集群资料
- 2024-11-01部署MySQL集群教程:新手入门指南
- 2024-11-01如何部署MySQL集群:新手入门教程
- 2024-11-01部署MySQL集群学习:新手入门教程
- 2024-11-01部署MySQL集群入门:新手必读指南