• slider image 285
:::
windelf - 數位學習 | 2014-01-20 | 點閱數: 2982

登入 phpmyadmin ,網頁畫面往下拉, phpmyadmin 會把現有的問題顯示出來。
A. 有新的 phpmyadmin 可用,請考慮升級。
   備份你的 config.inc.php 檔案。
B. phpmyadmin 高級功能未全部設置,部分功能不可用。
1 新增 control user

GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass';
GRANT SELECT (
        Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,
        Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,
        File_priv, Grant_priv, References_priv, Index_priv, Alter_priv,
        Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv,
        Execute_priv, Repl_slave_priv, Repl_client_priv
        ) ON mysql.user TO 'pma'@'localhost';
GRANT SELECT ON mysql.db TO 'pma'@'localhost';
GRANT SELECT ON mysql.host TO 'pma'@'localhost';
GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)

2 執行 create_tables.sql ,檔案位於 phpMyAdmin\scripts 目錄下。
3 授與權限
GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO 'pma'@'localhost';
4 修改 config.inc.php ,把以下設定前面//都拿掉就可以了
/* User used to manipulate with storage */
$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]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';

5 記得重啟 apache 來讓設定生效,重啟是最保險的方式。
   Note:執行完 create_tables.sql 還一直顯示有問題,請清 session file

C. 您配製文件中的配置(空密碼的 root)...

主要說沒設置密碼容易被入侵,請設置密碼。照以前的版本,應該是蠻容易完成一件事,可是試了最近的幾個版本,都一直無效。

從一般設定/修改密碼去設定完成後,我用 mysqladmin 去驗證,一樣還是不需要密碼,就可以登入了,不管是用 MySQL 4.0 或 MySQL 4.1x 的加密方式,就是無效。就只好用 mysql 本身提供的工具來完成這件事了。

D:\WebServer\mysql\bin>mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.5.14-log MySQL Community Server (GPL)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>use mysql; (切換資料庫)
Database changed
mysql> update user set password=password('yourpasswordhere') where user='root'; (更新密碼)
Query OK, 0 rows affected (0.01 sec)
Rows matched: 3 Changed: 0 Warnings: 0
mysql> DELETE FROM user WHERE User=''; (刪除空帳號,維護系統安全)
Query OK, 1 row affected (0.00 sec)
mysql> FLUSH PRIVILEGES; (即時更新上面設定)
Query OK, 0 rows affected (0.00 sec)
mysql> quit;
Bye

資料來源:

http://mark528.pixnet.net/blog/post/7267524-mysql%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7%28phpmyadmin%29