MariaDB: Access denied for user ‘root’ on grants

Автор | 23.12.2024

After upgdate MariaDB to version 11.3 when I try to grant some privileges on custom users with ‘root’ account, get error:

MariaDB [abright_ghost]> grant all privileges on user.* to 'db'@'%' IDENTIFIED  BY '1234';
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'db'

It because the root user doesn’t have all permissions ‘SHOW CREATE ROUTINE’ that can be fixed by adding permissions in the MariaDB

Restart MariaDB with additional command line argument:

mariadb .... --skip-grant-tables

Connect to the instance:

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.002 sec)

MariaDB [(none)]> GRANT ALL ON *.* TO root@localhost WITH GRANT OPTION;
Query OK, 0 rows affected (0.054 sec)

Remove ‘–skip-grant-tables’ and restart MariaDB

Залишити відповідь