MySql Access denied for user 'root'@'localhost' (using password: YES)

来源:互联网 发布:刻录软件收费 编辑:程序博客网 时间:2024/04/30 09:54

   在使用MySql的时候,如果出现 类是 Access denied for user 'root'@'localhost' (using password: YES)这样的错误提示,解决办法如下:

   1、查看用户  'root'@'localhost'  是否拥有权限,如下指令:

          show grants for root@'localhost' ;

          显示没有给root@'localhost' ;用户授权,则给用户root@'localhost' ;授权

   2、 给用户授权

       grant all on  *.*  to  root@'localhost' identified by 'password';

       给用root授予所有权限,密码为password;

   这样问题就ok了

 

原创粉丝点击