前兩天裝了個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
最終我還是不知道到底是哪個問題。。。。這個也不至於到刪除卸載了依舊不能用的啊。。。。跟流氓軟件一樣了!