0

I'm working on creating a test system and need to grant a user remote database access. I'm doing this with the following:

mysql> SHOW GRANTS for codingo;
ERROR 1141 (42000): There is no such grant defined for user 'codingo' on host '%'
mysql> GRANT ALL PRIVILEGES ON *.* to 'codingo'@'localhost' WITH GRANT OPTION;
Query OK, 0 rows affected (0.01 sec)

However after I flush privileges and then review them, they don't appear to apply:

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW GRANTS for codingo;
ERROR 1141 (42000): There is no such grant defined for user 'codingo' on host '%'

I'm currently using:

mysql Ver 14.14 Distrib 5.7.23, for Linux (x86_64) using EditLine wrapper

The user is however showing with permissions when I perform:

mysql> select * from mysql.user where user='codingo' and host='localhost';

I've also edited:

/etc/mysql/mysql.conf.d/mysqld.cnf 

To bind-address 0.0.0.0 (planning to harden after debugging this) which still hasn't allowed remote connections.

However I'm unable to connect to this remotely, or even locally with this user.

This is on a fully patched Ubuntu server. I've also run the MySQL hardening script, so I presume something there is preventing me from creating an additional administrator, but I don't know enough about this to solve the problem via Google. Certainly open to suggestions!

4

The error says it all

ERROR 1141 (42000): There is no such grant defined for user 'codingo' on host '%'

You set a grant for localhost but checked the grant for %.

Try

SHOW GRANTS for codingo@localhost;
1
  • 1
    Ah! Today I learnt. Since this then wasn't the cause and I could see the grants I decided to step back and create a new password for the user which in turn worked to solve my problem. Thank-you! – Michael A Oct 17 '18 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.