现在至少需要mysql添加一个只读权限
INSERT INTO user (Host,User,Password) VALUES('%','zhouwei',PASSWORD('zhouwei'));
update user set Show_db_priv='Y',Select_priv='Y' where Host='%' and User='zhouwei';
FLUSH PRIVILEGES;
然后添加phpmyadmin/config.inc.php
/*
* End of servers configuration
*/
在这行注释只上添加
/**
#example
$i++;
# Authentication type and info
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'zhouwei';
$cfg['Servers'][$i]['password'] = 'zhouwei';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['extension'] = 'mysqli';
*/