Failure to connect to your MySQL database server. MySQL reports the following message: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (46).

* 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?

http://www.akarmaworks.com/drupal/install.php?profile=default

I have an account with yahoo webhosting , I am able to login into the DB using the phpAdmin but drupal complains
i tried changing the hostname but didnt work. I manually edited the settings.php to put in the correct url that didnt work too.
I have all the privileges for this user in the db
Can some one please suggest what iam doing wrong?

Comments

vm’s picture

trust that its one of the things that is causing drupal to spit that error.

phpmyadmin, should list at the top of the first page, your hosts mysql server address.
insure that your host doesn't prefix your username and database.

example, to avoid naming conflicts, my host prefixes my database with the first 5 letters of my domain name following by an underscore. Thus if my domain is drupalrocks, and my database is named drupal my db name would be drupa_drupal.

if you are 100% positive that your username and password are correct, then it has to be the mysql server address.

timmy151’s picture

VeryMisunderstood-

I too have a site with Yahoo! and PHPMyAdmin installed. I have worked extensively with PHPMyAdmin in the past with few problems. On the opening page it says "MySQL 4.1.14 running on [website url] as [username]@localhost".

I have a database_connect script which i have used successfully to access the database so I know that my username and password are correct.

I still am unable to complete my database configuration. I get the same message as the last guy.

"Failure to connect to your MySQL database server. MySQL reports the following message: Can't connect to MySQL server on [website] (61)."

I even tried in the advanced options to manually enter the website url.

Any help is much appreciated. I am very excited to try out drupal as it looks to be incredibly robust software.

(Final Thought: Could it be a problem if my database is located in a subdirectory?)

vm’s picture

your database in a subdirectory ?

Did you mean your drupal install in a subdirectory ?

anandjay’s picture

I have almost the same problem as described above. I'm hosted by DreamHost, and I got drupal 5.2 to work on a different domain of mine a few months ago, so I know that the issue can't be a prefix on my database name.

Now I'm trying to install drupal 6 (not upgrade; install on a different domain), and I keep getting this error message:

/Failed to connect to your MySQL database server. MySQL reports the following message: Unknown MySQL server host '[database]' (1).

* 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?/

Like avyaktha, I also tried changing the database settings manually in sites/default/default.settings.php. Any suggestions?

Thanks for your help!!

Kimster’s picture

I have virtually the same and feeling desperate - if anyone knows a solution would be grateful:

Database configuration

The following error must be resolved before you can continue the installation process:

Failure to connect to your MySQL database server. MySQL reports the following message: Can't connect to local MySQL server through socket '/var/lib/mysql/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?

jfkelley’s picture

Host: webhosting.yahoo.com

phpMyAdmin says:
Server version: 4.1.14
Protocol version: 10
Server: mysql via TCP/IP
User: jkadmin@localhost

In ./sites/default/settings.php, I tried both:
$db_url = 'mysql://username:password@localhost/databasename';
$db_url = 'mysql://jkadmin:MYPASSWORDWENTHERE@localhost/databasename';

On drupal's Database Configuration page (in install.php), I got:
Failure to connect to your MySQL database server. MySQL reports the following message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2).

I tried both jkadmin and jkadmin@localhost as the Database Username with the same result.

I had used phpMyAdmin to set up a third db called hoadb (Yahoo already had dbs mysql and yahoo_site_admin). This is an empty db with no tables.

I made jkadmin the administrator id for hoadb (in addition to yroot which was automatically an admin user). It granted ALL PRIVILEGES to both ids.

John F. ("Jeff") Kelley, Ph.D., CHFP
Sr. Managing Consultant [global tech firm]
Past-president, Human Factors and Ergonomics Society
Adjunct Professor, Georgia Tech
Tenor

jfkelley’s picture

When I clicked Advanced Settings (or some such) hyperlink at the bottom of the Database Configuration page, I got a place to enter the server, which was localhost. I simply typed in mysql

Not that this was the "Server:" reported on phpMyadmin home page (sans the "via TCP/IP" stuff)

Much easier than trying to figure out the settings.php file!

John F. ("Jeff") Kelley, Ph.D., CHFP
Sr. Managing Consultant [global tech firm]
Past-president, Human Factors and Ergonomics Society
Adjunct Professor, Georgia Tech
Tenor

srini_rg’s picture

Hi, Specifying mysql as host under advanced options solved this problem for me. FYI, I am using yahoo India hosting. And thanks again. May the Drupal Community prosper!

livefordo’s picture

Hi Guys,

I am sivakumar. The same error i got . But i solved it

Just login to your PHPMyAdmin account now you can see the SERVER name in the top for
ex: Server: xxxxxxxx (It's server ip)...That is your database host copy and use it .... That's all :-)

Thanks to drupal
Sivakumar.S
www.pokkisam.com

SFDoug’s picture

Wow, this took some doing. Thanks for those who posted their solutions above. What tripped me up was that in the database host, I kept typing the full location, but it only needed "mysql" - no slashes, or anything else.

Cheers,

Doug from San Francisco

ryland007’s picture

Error Says: Failed to create a test table on your MySQL database server with the command CREATE TABLE drupal_install_test (id int NULL). MySQL reports the following message: Access denied for user 'ryland007'@'localhost' to database 'mysql'.

Yahoo Server

Server version: 4.1.14
Protocol version: 10
Server: mysql via TCP/IP
User: ryland007@localhost

I changed permissions to 666 in filezilla. Tried manual changes to settings.php.

Inputed
database name: mysql
user name: ryland007
password: ***********

In advanced options under database host: mysql

Anyone have any suggestions why they are giving me this error message?

petiar’s picture

Drupal is stupid. I have got this very same error (Unkown host) although I host another Drupal site on the same server succesfully and I have been entering the very same socket string. What I have done is to copy the settings.php which works to the sites directory of the Drupal installation which gone crazy. ;-)

--
Petiar
http://petiar.sk

rbeins’s picture

Just open phpmyadmin and at the top of your page of the phpmyadmin is the host of your database server and copy the address and past it in the host field, it should work.

TeshGuru’s picture

it doesn't matter you put all the files in a sub folder. But make sure to select advanced option and give database host name an your domain. also make sure you have both settings.php and default.setting.php files in your sites/default folder otherwise it throws an error.