I am receiving the following error during a Drupal 6.13 installation:

Failed to connect to your MySQL database server. MySQL reports the following message: Unknown MySQL server host 'localhost:/tmp/mysql5.sock' (1).

My host requires an extended hostname to connect to the MySQL database:

host = localhost:/tmp/mysql5.sock

I've created a new database and user for that database with full permissions:

dbname = domain_drupal
user = drupaluser
pw = drupalpass

I verified that I can connect to MySQL with this information, via phpMyAdmin. I've used that hostname with other php / database / CMS installations (notably Joomla)

In the Database Configuration page for Drupal, I specified:

Database Name = domain_drupal
Database Username = drupaluser
Database Password = drupalpass
Database Host = localhost:/tmp/mysql5.sock

I leave Database Port and Table Prefix blank.

Any suggestions?

Comments

guatebus’s picture

creating a php.ini file in the drupal installation root folder. I added these lines to the php.ini to make it work:

mysql.default_socket = /tmp/mysql5.sock
mysqli.default_socket = /tmp/mysql5.sock

In the installer I left 'localhost' only in db server field.
:D