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!
Best Answer
The error says it all
You set a grant for
localhost
but checked the grant for%
.Try