I have the following grants for a user/database
mysql> SHOW GRANTS FOR 'username'@'localhost';
+---------------------------------------------------------------------------+
| Grants for username@localhost |
+---------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'username'@'localhost' IDENTIFIED BY PASSWORD 'xxx' |
| GRANT ALL PRIVILEGES ON `userdb`.* TO 'username'@'localhost' |
+---------------------------------------------------------------------------+
To enable external access to the database, I need to change localhost to %. One way to do this is REVOKE all permissions and set it again. The problem is, that there is a password set which I don't know, so if I revoke the permission, I can't set it back.
Is there a way to change the hostname localhost to % (and back again) without revoking the permission itself?
mysql.userSETHost= 'localhost' WHEREuser.Host= '%' ANDuser.User= 'XXXdbusr'; – Jadeye Jul 21 '15 at 12:45FLUSH PRIVILEGESis not sufficient for some reason, so you might need to restart the server. – Artur INTECH Apr 28 '19 at 15:11