← Back to team overview

maria-discuss team mailing list archive

GRANT error - undocumented?

 

Hello,

I’ve found an apparent discrepancy between MySQL 5.6 and MariaDB 10.1. When you GRANT ALL PRIVILEGES on a DB to a user/host that is not in the mysql.users table, MariaDB 10.1 throws ER_PASSWORD_NO_MATCH, whereas MySQL 5.6 creates the user/host entry.

Is this by design? I don’t see the behavior discussed at https://mariadb.com/kb/en/mariadb/grant/.

Thank you for your time! Below I am including the client outputs for both servers.

-Felipe Gasper
Houston, TX

--------------------------
Server version: 10.1.8-MariaDB-log MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database fgtemp;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> use fgtemp;
Database changed
MariaDB [fgtemp]> grant all on fgtemp.* to 'root'@'nowhere';
ERROR 1133 (28000): Can't find any matching row in the user table
MariaDB [fgtemp]>
--------------------------
Server version: 5.6.27-log MySQL Community Server (GPL)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database fgtemp;
Query OK, 1 row affected (0.00 sec)

mysql> use fgtemp;
Database changed
mysql> grant all on fgtemp.* to 'root'@'nowhere';
Query OK, 0 rows affected (0.05 sec)
--------------------------


Follow ups