ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or column(s) or function(s)

Database changed
MariaDB [mysql]> UPDATE user SET plugin=’ ’ WHERE user =‘root’;
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
MariaDB [mysql]> UPDATE user SET plugin=’ ’ WHERE user =‘harsha’;
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
MariaDB [mysql]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.000 sec)

Can you explain what you are trying to achieve?

I think this is a securization procedure after installing mariadb, but no longer works on recent mariadb versions.

Try mysql_secure_installation instead. This setup the database engine properly.

Hope this helps.

Hi.,

I am basically installing erpnext setup on ubuntu and mariDB.

I suspect you’re attempting this install on ubuntu 22.04 and/or MariaDB 10.6 and above. if yes, the above syntax won’t work. follow the steps below to grant the necessary permissions:

mysql -u root -p{Provide your root password here}
USE mysql;
ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password;
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('Provide your root password here') ;
FLUSH PRIVILEGES;
exit

This will grant the necessary permissions you need to proceed.

1 Like