換了個新硬盤,下了個xampp裝上。不用apache、mysql、php單獨安裝配置了。MySQL的root密碼為空,可以通過MYSQL_HOME/bin目錄中的mysqladmin工具來修改:
mysqladmin -u root -p password YOUR_PASSWORD_HERE
然后會提示輸入當前的root密碼,直接回車就行了。
網上還有其他的方法,順便轉過來:
進入MySQL,然后使用下面的命令:
grant select on *.* to root@’%’ identified by “YOUR_PASSWORD_HERE”;
grant select on *.* to root@localhost identified by “YOUR_PASSWORD_HERE”;
Unix/Linux可以通過安全模式進入MySQL:
關閉MySQL:killall -TERM mysqld
安全模式進入:bin/safe_mysqld –skip-grant-tables &
更新root密碼:
>use mysql
>update user set password=password(”new_pass”) where user=”root”;
>flush privileges;
重啟MySQL服務
Apache中修改目錄時,需要修改如下兩個地方:
DocumentRoot “D:/xampp/htdocs”
<Directory “D:/xampp/htdocs”>
只修改一處會出現無訪問權限的問題。