1

It turns out that a user cannot set default database if it does not have global (mysql.user) or any database-level permissions (mysql.db):

MariaDB [(none)]> use mysql;
ERROR 1044 (42000): Access denied for user 'XXX'@'%' to database 'mysql'

However, using default database could be convenient, e. i. there is a lot old scripts relying on that.

The only workaround I've found so far, is to grant SHOW VIEW on the database: I do not want to grant even read-only access for all tables.

What do I miss? I don't know any SQL syntax that allows insert 'N' in all relevant columns in mysql.db, and don't want to do it with raw SQL (INSERT ...).

2
  • you may grant usage if you want to give just the connect access to some user, couldn't get what exactly you are asking for. Mar 21, 2016 at 15:31
  • Your statement is not quite correct. Your root probably has no entry in mysql.db, yet has no trouble with USE. Please give an example of both the GRANT and USE that cause trouble.
    – Rick James
    Mar 21, 2016 at 18:39

1 Answer 1

0

Well, thanks Rick James, it is a bit more complicated. The problem is with MariaDB.

Update: https://jira.mariadb.org/browse/MDEV-9614

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.