mysql 5.7忘记密码及重新更改目录,无相关文件

本文记录了在MySQL配置更改后遇到的多个错误及其解决过程,包括找不到mysql.plugin表、GTID表未准备好、SSL设置失败等问题,并给出了具体的解决步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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 key
2018-06-14T08:14:22.150267Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2018-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 tables
2018-06-14T08:14:22.152321Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2018-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)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值