MySQL运行此查询时出错:
mysqli_query($connect,"GRANT SELECT,INSERT ON myblog.*
TO '$username'@'localhost' IDENTIFIED BY
(SELECT user_password from users where user_name = '$username')")
or die("fail to grant ".mysqli_error($connect));
这个查询有什么问题?有没有更好的解决方案?
答案 0 :(得分:0)
MySQL不支持外部语句为GRANT
的子查询。
A subquery's outer statement can be any one of: SELECT, INSERT, UPDATE, DELETE, SET, or DO.
编辑:取自MySQL docs on subqueries。