Trying to give a user permissions for a database within cpanel and getting the error:
(XID xxxxxx) Database Error: There is no such grant defined for user “mysql_user” on host “host.name.com”
to fix the issue, ssh in to the server and first make a backup of the mysql configuration file
cp -rp /etc/my.cnf /etc/my.cnf.backup
then edit the original file and look for this line:
skip_name_resolve
if it’s there, remove the line and save the configuration file, then restart mysql:
/bin/systemctl restart mysql.service
Then if you already created the user, delete the user within cpanel and recreate it, then when you try to grant the user permissions to the database it should work this time.
From what I understand this is an issue with that skip_name_resolve setting only allowing ip addresses to be used with mysql grants, but cpanel tries to use “localhost” instead so it fails. For more information see
http://dev.mysql.com/doc/refman/5.7/en/server-options.html#option_mysqld_skip-name-resolve