![]() ![]() Open mysql configuration file named my.cnf and try to find "bind-address", here replace the setting (127.0.0.1 OR localhost) with your live server ip (the ip you are using in mysql_connect function).It is recommended to run MySQL with the config variable in my.cnf: ![]() If this is the case, you need to upload the script to the webserver (which is probably also running the MySQL server) and keep your server host as 'localhost' Another common cause of connect timeouts is the reverse-DNS lookup that is necessary when authenticating clients. Logging in as 127.0.0.1 is not always the same as logging in as localhost for some environments. Bash Copy ssh-add /.ssh/idrsa The private key passphrase is now stored in ssh-agent. Bash Copy eval ' (ssh-agent -s)' Now add the private key to ssh-agent using the command ssh-add. It might be because the MySQL server is bound to the loop-back IP (127.0.0.1 / localhost) which effectively cuts you off from connecting from "outside". Verify and use ssh-agent and ssh-add to inform the SSH system about the key files so that you do not need to use the passphrase interactively. Usually it indicates network connectivity trouble and you should check the condition of your network if this error occurs frequently. Is there anything in cpanel on my VPS that could be blocking mysql somehow? In the same instance of navicat, I can connect to my dedicated server using ssh tunnels with no issues from both comptuers/IPs. I can connect to mysql from a root ssh using the cpanel account credentials via command line. I can use putty to ssh from either computer no issues. I have php scripts that connect fine with the mysql /account passwords I'm using. I've tried using passwords for ssh, I've tried using keys for ssh. I've tried from two different computers, with two different IPs to several different cpoanel accounts. The tunnel connects (based off the ssh login emails I get), but not mysql to localhost. I'm even tried a root tunnel (vs a user account ) but it won't connect. I am using navicat light and using an ssh tunnel to connect so there is no need to enable remote mysql access in cpanel. But for the life of me I can't get it to work anymore. I know I used to be able to do this, and I can still do this on my dedicated. On my VPS, it seems I can no longer connect to mysql using the account's username. This is going to be something stupid, but I've wasted way too much time on this. ![]()
0 Comments
Leave a Reply. |