Error Message: Unable to connect to any of the specified MySQL hosts.
So open the my.cnf file by running a similar command to the following one dependent on your server’s setup:
Then edit the bind-address from what is probably set as 127.0.0.1 (also known as localhost) to your server’s remotely accessible IP address.
If you are unsure what your server’s IP address is then you need to ping it from the command line on another machine outside it’s network (e.g. your own machine) as follows:
N.B. If you are running a Dovecot/Postfix type email gateway setup on the same machine, changing your mysql bind-address will affect it’s connection to the database and you will no longer be able to send/receive emails through it. So you will have to adjust your Dovecot/Postfix configuration files where relevant.