Symptoms
The following database error happens when attempting to create or restore a database:
CONFIG_TEXT: View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
Cause
This issue is caused by the maridb.sys user not having the correct privileges. You can verify this by running the following command, which should reproduce the error:
# mysql mysql -e 'select * from user;'
Resolution
- Log in to the server via SSH or WHM's Terminal as the
rootuser Backup the existing MySQL database by running the following command:
# mysqldump mysql > /root/mysql.sql
Access the MySQL database via the MySQL CLI:
# mysql mysql
Run the following query:
MYSQL_LIN: mysql> INSERT INTO `tables_priv` (`Host`, `Db`, `User`, `Table_name`, `Grantor`, `Timestamp`, `Table_priv`, `Column_priv`) VALUES ('localhost','mysql','mariadb.sys','global_priv','root@localhost','0000-00-00 00:00:00','Select,Delete','');
Restart the service:
# /scripts/restartsrv_mysql
Comments
0 comments
Article is closed for comments.