docker logs mysql查看日志

1、情况一(‘STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION’ to ‘sql_mode’.)

ERROR: mysqld failed while attempting to check config
command was: "mysqld --verbose --help"
2020-03-13T09:35:44.881652Z 0 [ERROR] [MY-000077] [Server] /usr/sbin/mysqld: Error while setting value 'STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' to 'sql_mode'.

修改my.cnf

MYSQL8以上已经取消了NO_AUTO_CREATE_USER,sql_mode中不能包含这个。

sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION

2、情况二(mysqld: Error on realpath() on ‘/var/lib/mysql-files’ (Error 2 - No such file or directory)

2020-03-13T09:38:21.821848Z 0 [ERROR] [MY-010095] [Server] Failed to access directory for --secure-file-priv. Please make sure that directory exists and is accessible by MySQL Server. Supplied value : /var/lib/mysql-files
2020-03-13T09:38:21.824249Z 0 [ERROR] [MY-010119] [Server] Aborting
Initializing database

在这里插入图片描述
windows下:修改my.ini 在[mysqld]内加入secure_file_priv=/var/lib/mysql
linux下:修改my.cnf 在[mysqld]内加入secure_file_priv=/var/lib/mysql

docker部署mysql参考地址

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐