mysql 密码不对

ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: YES)

一,修改my.ini.重启mysql服务(记得重启哦.).

  在mysqld 下面加一行 skip-grant-tables

  

  或者 在mysql\bin 目录下CMD skip -grant -table  

二.空密码登录,选择数据库

   mysql -u root -p;            #空密码登录 

     show databases;      #查看数据库

     use db_name;       #选择数据库

三.更改密码

   update user set password =password("*********")  where user="root";         #更改密码

   flush privileges;                            #刷新数据库

 

 

mysqld --defaults-file=my.ini --initialize-insecure

update user set authentication_string="123456";

   exit;

四.还原my.ini

http://www.jb51.net/article/39454.htm

posted @ 2017-08-25 10:02  沈晓桐  阅读(1009)  评论(1编辑  收藏  举报