在初始化数据库时使用如下命令:
[root@localhost mysql]# bin/mysqld \
--initialize-insecure \
--user=mysql \
--basedir=/usr/local/mysql \
--datadir=/usr/local/mysql/data
问题描述1
2020-08-16T18:34:32.735665Z 0 [ERROR] bin/mysqld: Error while setting value 'NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_AUTO_VALUE_ON_ZERO,NO_' to 'sql_mode'
2020-08-16T18:34:32.735702Z 0 [ERROR] Aborting
解决办法
my.cnf配置文件出错
问题描述2
2020-08-17T01:02:33.687845Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2020-08-17T01:02:33.687883Z 0 [ERROR] Aborting
解决办法
[root@localhost mysql]# cd data
[root@localhost data]# rm -rf *
再重新初始化
问题描述3
2020-08-17T00:36:01.237874Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
解决办法
在/etc/my.cnf配置文件的[mysqld]下面添加一行
vim /etc/my.cnf
[mysqld]
...
explicit_defaults_for_timestamp=true ###添加参数,关闭警告