赞
踩
应该为缺少配置文件
首先创建文件:touch /mydata/mysql/conf/my.cnf
之后在my.cnf中加入如下:
[mysqld]
user=mysql
character-set-server=utf8
default_authentication_plugin=mysql_native_password
secure_file_priv=/var/lib/mysql
expire_logs_days=7
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
max_connections=1000
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
保存退出,之后重新启动mysql容器:
docker run -p 3306:3306 --name mysql
-v /mydata/mysql/log:/var/log/mysql
-v /mydata/mysql/data:/var/lib/mysql
-v /mydata/mysql/conf/my.cnf:/etc/mysql/my.cnf
-e MYSQL_ROOT_PASSWORD=root
-d mysql:8.0.30
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。