数据库初始化遇到过的那些坑.
[ERROR] Can’t find error-message file ‘/usr/local/mysql/share/errmsg.sys’. Check error-message file location and ‘lc-messages-dir’ configuration directive.
[root@localhost ~]# /opt/server/mysql/bin/mysqld --initialize-insecure --user=mysql --datadir=/opt/data/
2021-01-21T01:27:11.134607Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-01-21T01:27:11.134803Z 0 [ERROR] Can't find error-message file '/usr/local/mysql/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2021-01-21T01:27:14.243535Z 0 [Warning] InnoDB: New log files created, LSN=45790
2021-01-21T01:27:14.480270Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2021-01-21T01:27:14.549530Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: cac41e79-5b87-11eb-b5d3-000c298aaed4.
2021-01-21T01:27:14.567964Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-01-21T01:27:16.051819Z 0 [Warning] CA certificate ca.pem is self signed.
2021-01-21T01:27:16.342662Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
可以尝试下在初始化是加上 --basedir=
[root@localhost ~]# /opt/server/mysql/bin/mysqld --initialize-insecure --user=mysql --basedir=/opt/server/mysql --datadir=/opt/data/
2021-01-21T01:31:38.160910Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2021-01-21T01:31:41.635516Z 0 [Warning] InnoDB: New log files created, LSN=45790
2021-01-21T01:31:41.881108Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2021-01-21T01:31:41.951589Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 6a266e3c-5b88-11eb-bb49-000c298aaed4.
2021-01-21T01:31:41.955403Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2021-01-21T01:31:43.779301Z 0 [Warning] CA certificate ca.pem is self signed.
2021-01-21T01:31:44.300397Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.