windows 下mysql更新用户password异常后导致的问题

来源:互联网 发布:淘宝服装店铺页头图片 编辑:程序博客网 时间:2024/06/13 08:15

新装mysql,更新user 密码,记不清当时具体执行语句了,应该是正常的updat 。。。。set 。。。。。=“” where user=。。。。

结果导致用户表数据异常,登录后show databases;

+--------------------+

| Database |

+--------------------+

| information_schema |

| test |

+--------------------+

2 rows in set (0.00 sec)

再也看不到数据库名为mysql的库;

当执行create 等命令操作数据表时候,各种:

ERROR 1227 (42000): Access denied; you need (at least one of) the RELOAD privilege(s) for this operation

看日志各种:

2016-09-01 16:11:04 18384 [Warning] Found invalid password for user: 'root@localhost'; Ignoring user
2016-09-01 16:11:04 18384 [Warning] Found invalid password for user: 'root@127.0.0.1'; Ignoring user
2016-09-01 16:11:04 18384 [Warning] Found invalid password for user: 'root@::1'; Ignoring user

然后开始各种搜,网上各种啪啦啪啦,也不是那么回事。记录下自己的过程:

系统:windows

mysql:5.6.12

解决:

1.修改my.ini,在 [mysqld] 增加配置项:skip_grant_tables

2.重启mysql 服务;

3.能看到名为mysql的库了;(成功一小步。。。)

4.use mysql;

5.update user password =password("你要设置的密码") where user="root";(一定要执行对了语句,在密码那再不是直接=“”)

6.flush privileges;

7.exit;(这里应该顺道删掉my.inin里的配置项skip_grant_tables,或者注释也行)

8.重启mysql 服务;

整个世界和平了。。。。。。

0 0
原创粉丝点击