XAMPP(Apache+MySQL+PHP+PERL)是一個功能強大的建 XAMPP 軟件站集成軟件包,輕巧,用起來很方便。它提供了強大的phpmyadmin數據庫管理工具,讓使用者對數據庫的使用和管理駕輕就熟。對於不能在本地打開phpmyadmin的問題,個人解決方案以下:php
MySQL有一個默認的專用端口:3306,因此,若是你以前獨立安裝了MySQL,那麼3306端口已經被佔用。安裝XAMPP集成的MySQL時,必須從新設置獨立的端口,不然是不能訪問phpmyadmin的。mysql
修改方法也很方便,打開XAMPP的控制面板,找到mysql右側的config,點擊,會出現my.ini的選擇項,這個就是mysql的配置文件了。也能夠在XAMPP的安裝路徑下找:\xampp\mysql\bin\my.inisql
![](http://static.javashuo.com/static/loading.gif)
如圖中所示,將端口port改爲3307;固然只是修改端口,仍是訪問不了,還要去修改phpmyadmin的配置文件。數據庫
打開xampp目錄(找到xampp的安裝目錄),打開phpmyadmin的目錄,在該目錄下找到config.inc.php,即:\xampp\phpmyadmin\config.inc.php。apache
- <?php
- $cfg['blowfish_secret'] = 'xampp';
-
- $i = 0;
-
- $i++;
-
- $cfg['Servers'][$i]['auth_type'] = 'config';
- $cfg['Servers'][$i]['user'] = 'username';
- $cfg['Servers'][$i]['password'] = 'password';
- $cfg['Servers'][$i]['extension'] = 'mysqli';
- $cfg['Servers'][$i]['AllowNoPassword'] = true;
- $cfg['Lang'] = '';
-
- $cfg['Servers'][$i]['host'] = '127.0.0.1';
- $cfg['Servers'][$i]['connect_type'] = 'tcp';
-
- $cfg['Servers'][$i]['controluser'] = 'pma';
- $cfg['Servers'][$i]['controlpass'] = '';
-
- $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
- $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
- $cfg['Servers'][$i]['relation'] = 'pma_relation';
- $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
- $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
- $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
- $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
- $cfg['Servers'][$i]['history'] = 'pma_history';
- $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
- $cfg['Servers'][$i]['tracking'] = 'pma_tracking';
- $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
- $cfg['Servers'][$i]['recent'] = 'pma_recent';
- $cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';
-
-
- ?>
而後在$cfg['Lang'] =" "; 後加入如下代碼便可:cookie
- $cfg['Servers'][$i]['port'] = '3307'
保存文件,重啓apache,確保mysql打開,在地址欄輸入localhost/phpmyadmin,就能夠直接進入phpmyadmin的管理界面了,如圖所示:tcp
![](http://static.javashuo.com/static/loading.gif)