Symptoms
Should you find that clicking Delete for an Access Host on the Remote MySQL page of cPanel fails silently without error:
Check for space characters to be displayed in the host column of mysql.user:
# mysql -e " SELECT user,host FROM mysql.user WHERE host LIKE ' %';"
+-----------------+-----------------------+
| User | Host |
+-----------------+-----------------------+
| cptest | 10.0.10.10 |
| cptest_testuser | 10.0.10.10 |
+-----------------+-----------------------+
This query specifically matches entries where the host field has whitespace in it. This whitespace breaks the cPanel utility's ability to remove said IP.
Workaround
To correct this, you will need to do these things:
Remove the entries from mysq.user manually:
mysql -e "DELETE FROM mysql.user WHERE user like 'cptest%' AND host like '%10.0.10.10%';"Run the script to update cPanel's stored grants for the domain account:
Run the script to rebuild the cPanel storage of the accounts grants:
# /usr/local/cpanel/bin/dbstoregrants cptest
# grep 10.0.10.10 /var/cpanel/databases/grants_cptest.yaml
Manually remove any entries of the errant IP, from the MySQL access hosts notes, if they exist.
# cat /var/cpanel/mysql/notes/cptest.json
{" 10.0.10.10":"test1","10.0.10.11":"Testing"}
# vi /var/cpanel/mysql/notes/cptest.json
# cat /var/cpanel/mysql/notes/cptest.json
{"10.0.10.11":"Testing"}
Note that in each of the above examples, "cptest" is the domain account user, and 10.0.10.10 is the IP, which are utilized for demonstration purposes. These values will be different in your specific case, and should be entered accordingly.
Comments
0 comments
Article is closed for comments.