MySQL中连接不了,出现host ‘localhost’ is not allowed to connect to this MySQL server,该如何解决

MySQL中连接不了,出现host ‘localhost’ is not allowed to connect to this MySQL server

创建密码:

cmd下切换到   mysql   安装目录



d:/mysql/bin

前提:mysql用户root密码为空.

输入   mysql   -u   root   mysql  

mysql>   状态下输入   update   user   set   password=password( ‘新密码 ‘)   where   user= ‘root ‘;  

回显  

Query   OK,   0   rows   affected   (0.00   sec)  

Rows   matched:   2   Changed:   0   Warnings:   0  

mysql>   状态下输入   FLUSH   PRIVILEGES;  

回显

Query   OK,   0   rows   affected   (0.00   sec)

mysql>   状态下输入   quit  

退出   sql    

以前没有密码可以连接,可是我按上面的方法后,改了密码就连接不了?

帮忙啊。。。。。



mysql -u root -p 新密码

这样也不对?




-p开关

MySQL中连接不了,出现host ‘localhost’ is not allowed to connect to this MySQL server,该如何解决

相关文章:

你感兴趣的文章:

标签云: