将下面的内容另存为文件,放到服务器上执行就可以了,遇到这样的问题往往是升级的数据库,但把旧数据库所有的库全部考过来,而不是把用户库考来造成的。
错误提示如下:
Warning: Your privilege table structure seem to be older than this MySQL version!
Please run the script mysql_fix_privilege_tables that should be included in your MySQL server distribution to solve this problem!
$dbhost = 'localhost';
$dbuser = 'root';
$dbpw = 'password';
$db = new dbstuff;
$db->connect($dbhost, $dbuser, $dbpw, 'mysql');
unset($dbhost, $dbuser, $dbpw);
$match = explode('.', $db->version());
$mysql_verson = sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2]));
$mysql_fields = array();
$sql = 'SHOW FULL FIELDS FROM user';
$query = $db->query($sql);
while($mysql = $db->fetch_a