(Urgent) Can't connect to MySQL database

I have recently migrated my MySQL database to a different box from the install of XenForo. My firewall rules are all configured and I can connect to the database from the box with XenForo installed. However, my XenForo is still trying to connect to the local MySQL.

I have changed the config.php to the new IP address of the server, yet in my error log it suggests that it is trying to connect to the local MySQL.

Code:
PHP Fatal error:  Uncaught XF\\Db\\Exception: Access denied for user 'root'@'***.**.**.152' (using password: YES)
 
That generally indicates that the wrong username or password has been given, or the user provided doesn't have access to the database that has been provided.

Certainly the firewall rules seem to be working because this message is going directly from MySQL itself.
 
What was the solution here @Ciaran Baker ? I seems to have the same problem. I can log into mysql server via mysql from another server, but when I try in the XenForo install-wizard with the same dedicated user it failes with the message "Access denied for user 'databaseuser'@'<<web-server's ip address>>' (using password: YES). In the input for MySQL server I input MySQL-server's ip address, but from how I read the error it tries to use the webservers ip address. I've played around with the pw, and made it short and easy or long and complex, and always the same error.
 
Solved it. I think I by mistake had clicked "REQUIRE SSL" under global settings for the mysql user I was using.🤦‍♂️
 
You can actually use SSL by adding a couple of lines to config.php:

PHP:
$config['db']['ssl']['enabled'] = true;
$config['db']['ssl']['ca'] = 'path/to/cert.crt';

You will need a certificate though.
 
Top Bottom