小提示:這是比較進階的文章,不知道等一下的步驟在幹嘛的,就跳過整篇文章吧 

----------------------------------

想必有用PHP & MySQL寫過網頁吧,想必phpMyAdmin應該是你的好朋友 (笑)

phpMyAdmin裡,其中有個還不錯用的功能就是Designer
可以畫資料庫的關聯圖,對於資料表關聯的了解有很大的幫助

但這功能在之後的版本,預設被關掉了

在這裡可以教你怎麼把它打開

----------------------------------

而PHP & MySQL自己重頭裝到好的很多
市面上整合平台更多

Appserv、XAMPP、WAMP、MAMP...... 

對於裝在不同的系統(Win、Mac、Linux),路徑也會不致相同

但是有個好消息

phpMyAdmin對於平台的相依性很小
只要PHP和MySQL的環境有架起來
phpMyAdmin它,都能跑

如果你夠大膽,可以去官網下載最新版phpMyAdmin

http://www.phpmyadmin.net/home_page/index.php

 

然後換上去 (撰文的時候使用phpMyAdmin 3.5.1版)

----------------------------------

以我在使用的XAMPP為例

Windows 版的路徑:
C:\xampp\phpMyAdmin

Mac 版的路徑:
/Applications/XAMPP/xamppfiles/phpmyadmin

Linux 版的路徑:
/opt/lampp/phpmyadmin

 

Apache先關掉,
然後將舊版的phpMyAdmin備份起來(目錄更名),將新版3.5.1的phpMyAdmin複製上去(不要用取代的) 

----------------------------------

打開目錄底下的config.sample.inc.php,複製一份
檔名叫config.inc.php

使用文字編輯器打開

找到以下這一段:

/*
* phpMyAdmin configuration storage settings.
*/

/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'pmapass';

/* Storage database and tables */
$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]['table_uiprefs'] = 'pma_table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
$cfg['Servers'][$i]['recent'] = 'pma_recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';

拿掉註解(不同版本,其中的值可能有多有少,會有些許不同,
找到你的那一段,不要直接複製,除非你很確定版本和我的相同),然後存檔

然後再打開Apache

----------------------------------

phpMyAdmin用MySQL的root帳號登入之後
點選匯入

檔案選擇 examples/create_tables.sql 的檔案,執行之後
會出現名字叫phpmyadmin的資料庫

然後按左上角的Exit鈕重新登入

就會選取資料庫時,就會看見Designer了

 

 

 

參考資料:

Enable Designer in PHPMyAdmin

http://www.novell.com/communities/node/8932/enable-designer-phpmyadmin

arrow
arrow
    全站熱搜

    Johnny 鋼鍊 發表在 痞客邦 留言(0) 人氣()