本文共 1874 字,大约阅读时间需要 6 分钟。
mysql更改配置后,数据库存储目录更改,mysql出现
mysqld: Table 'mysql.plugin' doesn't exist
2018-06-14T08:14:22.143907Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.2018-06-14T08:14:22.149103Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.2018-06-14T08:14:22.150239Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key2018-06-14T08:14:22.150267Z 0 [Note] Server hostname (bind-address): '*'; port: 33062018-06-14T08:14:22.150363Z 0 [Note] IPv6 is available.2018-06-14T08:14:22.150383Z 0 [Note] - '::' resolves to '::';2018-06-14T08:14:22.150431Z 0 [Note] Server socket created on IP: '::'.2018-06-14T08:14:22.151913Z 0 [Warning] Insecure configuration for --pid-file: Location '/opt/website/mysql/var' in the path is accessible to all OS users. Consider choosing a different directory.2018-06-14T08:14:22.152119Z 0 [Warning] Failed to open optimizer cost constant tables2018-06-14T08:14:22.152321Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist2018-06-14T08:14:22.152403Z 0 [ERROR] Aborting
[root@RCD var]# ./mysql_install_db --basedir=/opt/website/mysql --datadir=/opt/website/mysql/var/ --user=mysql
[root@chen ~]# /etc/rc.d/init.d/mysql stop
[root@RCD bin]# ./mysqld_safe --skip-grant-tables &
[root@RCD bin]# mysql -p
mysql> update mysql.user set authentication_string=password('123') where user='root' and Host = 'localhost';
mysql> flush privileges;
mysql> quit
[root@RCD bin]# /etc/rc.d/init.d/mysql restart
[root@RCD bin]# mysql -uroot -p
mysql> show databases;ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.mysql> SET PASSWORD = PASSWORD('123');Query OK, 0 rows affected, 1 warning (0.00 sec)
转载地址:http://zhdob.baihongyu.com/