0

When i try to use :

sudo mysql -u root
use mysql;
SELECT user, plugin FROM user;
UPDATE user SET plugin = "mysql_native_password" WHERE user = "root" ;
exit
service mysql restart`

it seems an 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

Update and Alter is not working

Georg Richter
  • 5,970
  • 2
  • 9
  • 15
  • 1
    Follow https://stackoverflow.com/questions/64841185/error-1356-hy000-view-mysql-user-references-invalid-tables-or-columns-o – nkkumawat Jan 26 '21 at 04:22
  • Does this answer your question? [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](https://stackoverflow.com/questions/64841185/error-1356-hy000-view-mysql-user-references-invalid-tables-or-columns-o) – Tangentially Perpendicular Jan 26 '21 at 05:51

1 Answers1

0

It is a very bad practice to modify system data directly instead of using SQL commands.

The solution is to use ALTER USER command (see https://mariadb.com/kb/en/alter-user/) instead of trying to modify a system view.

In recent versions of MariaDB user data is stored in mysql.global_priv table, mysql.user is just a complex view which aggregates information from mysql.global_prov.

Georg Richter
  • 5,970
  • 2
  • 9
  • 15