I have ZERO experience with MySQL databases. I went to my Cpanel, went into the MySQL Database Manager and added a user and password. Then I added a database under this user. I then uploaded all the drupal files to my server, making sure that the default folder has all permissions (777). I did the same with default.settings.php and settings.php.
Then I went to the installation web page for Drupal. I came to the Database configuration portion, entered the database name, username and password and received this:
Failed to connect to your MySQL database server. MySQL reports the following message: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
Are you sure you have the correct username and password?
Are you sure that you have typed the correct database hostname?
Are you sure that the database server is running?
For more help, see the Installation and upgrading handbook. If you are unsure what these terms mean you should probably contact your hosting provider.
The host is Aplus.net. I verified through a chat session that I had the username, database name, and password correct. They wouldn't help me with anything else.
Is there something else I need to do with the database setup? Why won't it connect?
Comments
From aplus.net, make sure you
From aplus.net, make sure you can connect using their example code:
http://upgrade.apluskb.com/search_kb.pl?showquestion=462
From Google, using the error message:
http://www.tech-recipes.com/rx/762/solve-cant-connect-to-local-mysql-ser...
There are lots more references if you do the search yourself as well.
database host
just to add to ScoutBaker, you need to click on Advanced and provide the database host, which is set to localhost by default but as the link from ScoutBaker suggest is actually sqlc1.megasqlservers.com in your case.
Thanks, this was indeed the
Thanks, this was indeed the problem.
Note to newbies like me....
Don't over look the collapsed menu "Advanced Options" on the Database page. There is a required host field in there that I apparently overlooked.
Shouldn't something with an asterisk not be in a collapsed menu? Or shouldn't the error message be that the host name is incorrect instead of a vague message that it couldn't connect to the database? Would have saved this newbie a lot of time and headaches!
Thanks for the responses.
=-=
except that many hosts use localhost.
You also stated that your host checked the database location and it was correct. Which evidentally it wasn't if it wasn't supposed to be set to localhost.