Home >Database >Mysql Tutorial >How to Fix MySQL Error 1356: Invalid Table References in Views?
ERROR 1356: Resolving Issues with Invalid Table References in MySQL Views
The MySQL 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" typically occurs when attempting to update the 'mysql.user' view, which is a system view that contains user information.
The 'mysql.user' view no longer exists as a table in MariaDB-10.4 . Instead, it is a virtual representation of user data. Thus, attempting to update it directly using a query like "UPDATE user SET Host='%' WHERE User='root'" will result in the error mentioned.
To resolve this issue, use alternative methods to manage user authentication in MySQL and MariaDB. The recommended approach is to employ either the "SET PASSWORD" or "ALTER USER" statements.
It's important to note that modifying the username by altering the user or host component can lead to inconsistencies with triggers, events, plugins, and various other components. Therefore, it's advisable to drop and recreate users rather than attempting to modify them directly.
The above is the detailed content of How to Fix MySQL Error 1356: Invalid Table References in Views?. For more information, please follow other related articles on the PHP Chinese website!