KDM Posted October 18, 2010 Share Posted October 18, 2010 Here is my code in admin_common.php. This is a website I had over at yahoo that I moved to Godaddy. define("EZSQL_DB_USER", "larryadmin"); // <-- mysql db user define("EZSQL_DB_PASSWORD", "mypassword"); // <-- mysql db password define("EZSQL_DB_NAME", "larryadmin"); // <-- mysql db pname define("EZSQL_DB_HOST", "mysql"); // <-- mysql server host I keep getting this error SQL/DB Error -- [ Error establishing a database connection! Are you sure you have the correct user/password? Are you sure that you have typed the correct hostname? Are you sure that the database server is running? ] SQL/DB Error -- [ Error selecting database larryadmin! Are you sure it exists? Are you sure there is a valid database connection? ] Please help thanks. Quote Link to comment https://forums.phpfreaks.com/topic/216174-cannot-connect-to-database-thru-my-admin_commonphp-file/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 18, 2010 Share Posted October 18, 2010 Did you bother to check the things the error is suggesting that you check? Quote Link to comment https://forums.phpfreaks.com/topic/216174-cannot-connect-to-database-thru-my-admin_commonphp-file/#findComment-1123507 Share on other sites More sharing options...
KDM Posted October 18, 2010 Author Share Posted October 18, 2010 Yes I did. I setup a database on Godaddy. Godaddy uses the name of the database as the username as well. When this site was on Yahoo, my username was different from my database name. My password and everything is correct. Quote Link to comment https://forums.phpfreaks.com/topic/216174-cannot-connect-to-database-thru-my-admin_commonphp-file/#findComment-1123508 Share on other sites More sharing options...
PFMaBiSmAd Posted October 18, 2010 Share Posted October 18, 2010 I'm going to guess that mysql is not your database server's host name (that's an incomplete host name at a minimum.) Perhaps if you referred to your new web host's documentation - http://community.godaddy.com/help/article/39 Quote Link to comment https://forums.phpfreaks.com/topic/216174-cannot-connect-to-database-thru-my-admin_commonphp-file/#findComment-1123509 Share on other sites More sharing options...
KDM Posted October 18, 2010 Author Share Posted October 18, 2010 I'm going to guess that mysql is not your database server's host name (that's an incomplete host name at a minimum.) Perhaps if you referred to your new web host's documentation - http://community.godaddy.com/help/article/39 Your guess was right! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/216174-cannot-connect-to-database-thru-my-admin_commonphp-file/#findComment-1123513 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.