webref.eu Posted October 25, 2009 Share Posted October 25, 2009 Hi All I am trying to connect to my MySQL database from a remote host. I have the standard PHP database connection code. I have added the remote IP address as an allowed one in cPanel. At the moment the remote host can't connect to the server. Is there a way to get more detailed info about the type of server connection error? I am thinking if I alter the PHP code I might be able to display a more detailed connection error message. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/178955-solved-how-do-you-get-more-info-on-mysql-server-connection-error/ Share on other sites More sharing options...
abazoskib Posted October 25, 2009 Share Posted October 25, 2009 try echo mysql_error(); or post the code Quote Link to comment https://forums.phpfreaks.com/topic/178955-solved-how-do-you-get-more-info-on-mysql-server-connection-error/#findComment-944159 Share on other sites More sharing options...
Mchl Posted October 25, 2009 Share Posted October 25, 2009 Make sure your host allows for remote MySQL connections. Even if you enabled it in cPanel, they might be blocking it somewhere else. Do you get 'Access denied for user...' message, or do you timeout? Quote Link to comment https://forums.phpfreaks.com/topic/178955-solved-how-do-you-get-more-info-on-mysql-server-connection-error/#findComment-944161 Share on other sites More sharing options...
webref.eu Posted October 25, 2009 Author Share Posted October 25, 2009 Thanks guys, I used mysql_error() and it turns out its a versioning problem. The MySQL server is v5 and the remote host I want to connect to it is v4. This means the password can't be recognised. The error I get is: Client does not support authentication protocol So it wasn't an IP access issue like I thought initially. Thanks for your help. Rgds Quote Link to comment https://forums.phpfreaks.com/topic/178955-solved-how-do-you-get-more-info-on-mysql-server-connection-error/#findComment-944278 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.