标签:
1.登录phpmyadmin,点击导入,选择/var/ww/html/phpmyadmin/examples/create_tables.sql并执行
完成后可以看到多出了一个库phpmyadmin。
2.编辑/var/www/html/phpmyadmin/config.inc.php文件(如果没有,就复制一份config.simple.inc.php),并取消以下项目的注释(库名和表名对应):
$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‘;
3.在phpmyadmin中选择phpmyadmin库,并执行以下sql语句
GRANT USAGE ON mysql.* TO ‘用户名@localhost‘ IDENTIFIED BY ‘密码‘;
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 ‘用户名@localhost‘;
GRANT SELECT ON mysql.db TO ‘用户名@localhost‘;
GRANT SELECT ON mysql.host TO ‘用户名@localhost‘;
GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)
ON mysql.tables_priv TO ‘用户名@localhost‘;
4.重新登录phpmyadmin
标签:
原文地址:http://www.cnblogs.com/tiger2soft/p/4851295.html