我一直在玩弄創建一個新用戶,我不斷收到此錯誤:MySQL的授予權限的用戶
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `testingUser' at line 3
和我的查詢是:
mysql_query("
GRANT USAGE ON *.* TO '$user'@'localhost' IDENTIFIED BY '$pass';
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `$user\_database`.* TO '$user'@'localhost';
GRANT SELECT (Table_priv, Column_priv, Table_name, Db, User, Host) ON `mysql`.`tables_priv` TO '$user'@'localhost';
GRANT SELECT ON `mysql`.`host` TO '$user'@'localhost';
GRANT SELECT (Host, Create_priv, Shutdown_priv, Delete_priv, User, Process_priv, Reload_priv, Alter_priv, Super_priv, Grant_priv, Create_tmp_table_priv, Execute_priv, Repl_client_priv, Insert_priv, Repl_slave_priv, Lock_tables_priv, References_priv, Index_priv, File_priv, Drop_priv, Show_db_priv, Select_priv, Update_priv) ON `mysql`.`user` TO '$user'@'localhost';
GRANT SELECT ON `mysql`.`db` TO '$user'@'localhost';");
'mysql_query'無法執行多個查詢 – Kru