I have an error with pt-show-grants on MariaDB 10.5, the following querie tries to be executed
SELECT DISTINCT User, Host FROM mysql.user ORDER BY User, Host"
But the table mysql.user no longer exists in mariadb 10.5, I have this error with pt-show-grants :
-- Grants dumped by pt-show-grants
-- Dumped from server Localhost via UNIX socket, MySQL 10.5.12-MariaDB-0+deb11u1-log at 2021-10-27 10:02:22
DBD::mysql::db selectall_arrayref failed: View 'mysql.user' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them [for Statement "SELECT DISTINCT User, Host FROM mysql.user ORDER BY User, Host"] at /usr/bin/pt-show-grants line 1943.
I run on Debian 11 with percona-toolkit 3.2.1
Is there a workaround for this problem?
The mariaDb documentation indicates that this table does indeed still exist in the latest version of MariaDB with both User and Host columns. Have you been able to execute this SQL directly?
Can you execute SHOW TABLES from within the mysql database and confirm the table does not exist?
I have imported a dump from mariadb 10.3 to mariadb 10.5, but I forgot to exclude the mysql.user table from my mysqldump.
Can I safely delete the user table in mariadb 10.5?
@emorino The mysql.user table absolutely exists in MariaDB 10.5. See proof here:
root@2c95de754d3c:/# mysql -uroot -p
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 10.5.12-MariaDB-1:10.5.12+maria~focal mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> select user,host from mysql.user;
| User | Host |
| root | % |
| mariadb.sys | localhost |
| root | localhost |
3 rows in set (0.003 sec)
If you delete this table, you will be unable to log in to MariaDB
Matt - try SHOW CREATE TABLE on mysql.user in 10.5
It is an non-deterministic view. MariaDB 10.4+ source of truth is mysql.global_privs.