XAMPP--Access denied for user 'root'@'localhost' (using password:YES)....& can't connect to localhost...

前两天装了个zendserver,想搭建一下PHP开发环境来着,结果问题层出不重。PHPAdmin访问localhost数据库,一直出现error:Access denied for user 'root'@'localhost' (using password:YES),HeidiSql之前好好的,现在也莫名进不去了。

在这之前,开始以为是忘记了mysql的root的密码,在网上搜索了很多修改密码的方法,“mysqld -nt -skip-grant-tables”等等,折腾了大半天后,依旧没有任何效果。最后还是忍痛把zendserver卸载了。

可是当我卸载完毕以后,访问localhost,依旧denied;我找到XAMPP,想用PHPAdmin看下这次能不能在这里访问localhost里的数据库了,结果发现还是之前一样,提示can not connect localhost,让检查username和password,以及port。好吧,我承认,zendserver是无辜的被我杀掉了,问题不在那里。

然后我又求助google了,这回找到了重点:http://forum.wampserver.com/read.php?2,42426

Re: Unable to connect to phpMyAdmin
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: October 12, 2008 10:56PM

i presume you set a password in mysql?


open C:\wamp\apps\phpmyadmin2.11.6\config.inc.php

find this line


$cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed
// with 'config' auth_type

and put the password you set in between the ''

then save and try again

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

我按照上述步骤,修改了config.inc.php,设置密码为root。O(∩_∩)O哈!马上可以进去了。

总结了下,问题的症结在于:原本mysql里设置了user=root时的password=“root”,也就是说localhost是可以用user=root,password=“root” 来访问的,但是装XAMPP一路默认下来的结果是user=root,password=“”。此时,使用XAMPP打开PHPAdmin时,当然就访问不了localhost的了!

still 为何会XAMPP的mysql密码不对,会导致HeidiSql也不做事儿了?不明白。。。。

ps:没过一会儿又出问题了,各种不理解的localhost不能正常工作的问题。

卸载也没用,在services列表里仍然指向:  C:\xampp\mysql\bin\mysqld.exe --defaults-file=c:\xampp\mysql\bin\my.ini mysql

在网上找到说停掉mysql服务,删除这三个文件下的Mysql文件夹

然后重新刷新服务列表(cmd->#指令名字忘记了!#)。发现依旧没解决问题。╮(╯▽╰)╭

最后把xampp重新装回来,localhost用无密码的root进去了,但是突然发现localhost下的database只有两个了:

最后,我总算想起来C:\xampp下面的readme_en.txt!  读了下去,顿时傻掉了:

ok,我的电脑配置比这个高太多,好吧,玩不起!!

win7啊!64bit system!你不支持,干嘛还让我装的顺顺利利的!!我给xampp做了两天测试啊。。。。

http://zhidao.baidu.com/question/251024768.html

最终我还是不知道到底是哪个问题。。。。这个也不至于到删除卸载了依旧不能用的啊。。。。跟流氓软件一样了!

 

posted @ 2012-06-26 15:25  小侠女  阅读(6517)  评论(0编辑  收藏  举报