cPanel using wrong hostname to connect to MySQL server
I've recently set up a fresh cPanel installation with MySQL running on a separate server.
When I verify the MySQL database profile via WHM>>Manage MySQL Profiles>>Validate, it's all good.
But when I create a database via cPanel, it doesn't appear in the user's cPanel>>phpMyAdmin and PHP connections fail with the message "Access denied for user 'user'@'hostname' (using password: YES)"
I notice that the hostname appended after the username in the error message is incorrect. Which would explain why the user isn't recognised. How do I get cPanel to use the correct current hostname when connecting to the remote MySQL server?
-
Server reboot fixed the hostname issue. Found the real problem was a '$' symbol in the password that was causing PHP to truncate the password at that character, therefore sending the wrong password to MySQL. 0 -
Perhaps MySQL needed restarting. I am glad to hear you were able to resolve the issue. Good catch on that password variable issue! 0 -
Server reboot fixed the hostname issue. Found the real problem was a '$' symbol in the password that was causing PHP to truncate the password at that character, therefore sending the wrong password to MySQL.
Ditto. Have had this happening for quite a while now. I never put time into checking if it's a known MySQL known issue or limitation (try setting a password that way by command line? maybe) vs. a problem with how cpanel treats the form input it sends to the server. With database authentication issues, we now immediately ask first if there's a $ in it!0
Please sign in to leave a comment.
Comments
3 comments