Home >Database >Mysql Tutorial >How to Correctly Update MySQL User Privileges After MariaDB 10.4\'s `mysql.user` View Change?
MySql Error 1356: Invalid Table Reference in Update Query
When attempting to update the user table in MySQL with the query UPDATE user SET Host='%' WHERE User='root', users may encounter the following error:
ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
This error occurs because the mysql.user table is no longer a table in MariaDB-10.4 but instead is a view. As a result, direct modifications to this view are no longer permitted.
Solution
To resolve this issue, it is recommended to use the following methods to manage user authentication in MySQL and MariaDB:
Note:
The above is the detailed content of How to Correctly Update MySQL User Privileges After MariaDB 10.4\'s `mysql.user` View Change?. For more information, please follow other related articles on the PHP Chinese website!