xampp服務器搭建和使用

1.安裝完XAMPP後會出現Apache端口被佔用的問題,一下方法解決php

  1. 錯誤信息以下:html

    Error: Apache shutdown unexpectedly.mysql

    9:37:01  [Apache] This may be due to a blocked port, missing dependencies, sql

    9:37:01  [Apache] improper privileges, a crash, or a shutdown by another method.數據庫

    9:37:01  [Apache] Press the Logs button to view error logs and checkpost

    9:37:01  [Apache] the Windows Event Viewer for more cluesui

    9:37:01  [Apache] If you need more help, copy and post thisthis

    9:37:01  [Apache] entire log window on the forumsspa

    xampp啓動出錯:This may be due to a blocked
  2. 2

    應該是端口的問題,這裏使用程序提供的設置功能設置一下端口,具體須要點擊程序界面上的【config】按鈕。.net

    xampp啓動出錯:This may be due to a blocked
  3. 3

    在新窗口中點擊【server and por setting】,在設置窗口上輸入對應的對應的端口,須要記得一般狀況下80窗口及443窗口能夠一塊兒修改。

    xampp啓動出錯:This may be due to a blocked
    xampp啓動出錯:This may be due to a blocked
  4. 4

    回到後,再次點擊啓動,仍是出錯。。。。會不會是沒有被修改,只能看一下程序下的配置文件,點xampp後的config,須要注意的是80端口及443端口須要分別設置。

    xampp啓動出錯:This may be due to a blocked
    xampp啓動出錯:This may be due to a blocked
  5. 5

    打開配置文件後,直接使用搜索功能找到80端口的配置,將端口修改成801之類的,443端口一樣,須要修改成其它端口,保存文件。

    xampp啓動出錯:This may be due to a blocked
  6. 6

    配置好後,點擊啓動,能夠正常了。這裏須要注意的事情是,第一次配置用的端口要與第二次手動配置的保持一致,由於點擊界面上的【admin】啓動管理界面時,使用的是第一次配置時使用的端口,只有保持一致才能打開網頁管理界面。

    xampp啓動出錯:This may be due to a blocked
    xampp啓動出錯:This may be due to a blocked
     
     
     
    數據庫密碼塊

    若是想把密碼改爲別的,能夠直接執行西面的SQL 語句,把new_password改爲本身的密碼便可:

    1
    UPDATE user SET password=PASSWORD( 'new_password' ) WHERE user= 'root' ;

    另外既然mysql的root用戶密碼已經修改了,那麼phpmyadmin中的對應密碼配置也要修改,找到配置文件,如個人是

    F: mppphpMyAdminconfig.inc.php

    找到以下代碼

     代碼以下 複製代碼

     Authentication type and info */$cfg['Servers'][$i]['auth_type']
     = 'config';$cfg['Servers'][$i]['user']
     = 'root';$cfg['Servers'][$i]['password']
     = '';$cfg['Servers'][$i]['extension']
     = 'mysql';$cfg['Servers'][$i]['AllowNoPassword']
     = true;

    修改成

     代碼以下 複製代碼


     Authentication type and info */$cfg['Servers'][$i]['auth_type']
     = 'config';$cfg['Servers'][$i]['user']
     = 'root';$cfg['Servers'][$i]['password']
     = '123456';$cfg['Servers'][$i]['extension']
     = 'mysql';$cfg['Servers'][$i]['AllowNoPassword']
     = true;

    這樣就會須要重啓登陸phpmyadmin了。

     

    忘記密碼怎麼辦

    1. 關閉正在運行的MySQL服務
    2. 打開DOS窗口,轉到mysql\bin目錄
    3. 輸入mysqld --skip-grant-tables 回車       --skip-grant-tables 的意思是啓動MySQL服務的時候跳過權限表認證
    4. 再開一個DOS窗口(由於剛纔那個DOS窗口已經不能動了),轉到mysql\bin目錄 
    5. 輸入mysql回車,若是成功,將出現MySQL提示符 >
    6. 鏈接權限數據庫: use mysql;
    6. 改密碼:update user set password=password("root") where user="root"; 
       mysql5.7以上版本-->    UPDATE user SET authentication_string=PASSWORD("root") WHERE User="root";
    7. 刷新權限(必須步驟):flush privileges; 
    8. 退出 quit。 
    9. 註銷系統,再進入,使用用戶名root和剛纔設置的新密碼123登陸。

相關文章
相關標籤/搜索