首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

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

2012-03-26 
MySQL中连接不了,出现host localhost is not allowed to connect to this MySQL server创建密码:cmd下切

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开关

热点排行