'Accessdenied for user 'root'@'localhost' (using password: YES)'解决方法:
从错误中可以看出你的权限是对localhost的访问没有放开。
于是你可以使用如下命令来放开权限:
首先计入到mysql的客户端命令行。(使用mysql)
grantall privileges on *.* to 'root'@'localhost' identified by '你的密码' with grantoption;
flushprivileges;
执行完这两条命令之后使用mysql –p之后敲入密码就可以了。
ERROR 1396 (HY000): Operation CREATE USER failed解决方法:
这是mysql的一个bug。需要flush privileges,步骤如下:
Drop user admin@localhost;
Flush privileges;
Create user admin@localhost identified by ‘admins_password’即可
在grant权限的时候访问拒绝的解决方法:
这是登录服务器的用户不具备grant权限,把grant权限赋予登录用户即可。
grantall privileges on *.* to 'root'@'localhost' identified by '你的密码' with grantoption;