Closed (fixed)
Project:
Drupal core
Version:
7.4
Component:
database system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
12 Dec 2005 at 23:14 UTC
Updated:
9 Dec 2012 at 12:10 UTC
Pure installation of current Drupal CVS cannot be done: drupal can't connect to DB: "can't contact the MySQL database server".
Installation of Drupal 4.3 and Drupal 4.7 beta1 with same database, user name and password are successful.
Comments
Comment #1
Steve Dondley commentedCan't duplicate. Highly unlikely this is a bug. More likely a settings or configuration error.
Comment #2
jm_drupal commentedCan't install Drupal 7.4 - does not connect to MySQL database
I am at the 'set up database' stage and I get prompted with:
Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
Is the database server running?
Does the database exist, and have you entered the correct database name?
Have you entered the correct username and password?
Have you entered the correct database hostname?
I am trying to install the drupal site on the localhost( URL: drupal.local )
I have checked all permissions (set to 777 for settings.php), but still no luck.
I have checked the database connection by creating a test.php page and it works (i get the success message).
http://drupal.local/test.php
Test.php contains:
define ('DATABASE_SERVER', 'localhost');
define ('DATABASE_USER', 'drupalcms');
define ('DATABASE_PASSWORD', 'Pa$$w0rd');
define ('DATABASE_NAME', 'drupalcms');
$db = mysql_connect(DATABASE_SERVER, DATABASE_USER, DATABASE_PASSWORD);
if (!$db) {
die('Could not connect: ' . mysql_error());
echo 'failed';
} else {
mysql_select_db(DATABASE_NAME ,$db);
echo 'Success';
}
What else i can try to install Drupal.
Comment #3
jm_drupal commentedCan't install Drupal 7.4 - does not connect to MySQL database
I am at the 'set up database' stage and I get prompted with:
Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).
Is the database server running?
Does the database exist, and have you entered the correct database name?
Have you entered the correct username and password?
Have you entered the correct database hostname?
I am trying to install the drupal site on the localhost( URL: drupal.local )
I have checked all permissions (set to 777 for settings.php), but still no luck.
I have checked the database connection by creating a test.php page and it works (i get the success message).
http://drupal.local/test.php
Test.php contains:
define ('DATABASE_SERVER', 'localhost');
define ('DATABASE_USER', 'drupalcms');
define ('DATABASE_PASSWORD', 'Pa$$w0rd');
define ('DATABASE_NAME', 'drupalcms');
$db = mysql_connect(DATABASE_SERVER, DATABASE_USER, DATABASE_PASSWORD);
if (!$db) {
die('Could not connect: ' . mysql_error());
echo 'failed';
} else {
mysql_select_db(DATABASE_NAME ,$db);
echo 'Success';
}
What else i can try to install Drupal 7.
I have iinstalled Drupal 6.22 without any issue, but i am getting the database connection error when i try to install Drupal 7.4. Any help would be much appreciated.
Comment #4
mdupontDid you check that the requirements for Drupal 7 are met (they are not the same than for D6)? Is PHP PDO enabled and working on your system? Your test.php file uses the mysql driver, not PDO. Drupal 7 uses PDO, Drupal 6 uses mysql(i) and postgresql drivers, they are not the same.
Comment #5
cweagansSupport requests are never critical or major.
Comment #6
dddave commented"Time" seems to have fixed this. Closing old, stale issues. If the issue still persists feel free to re-open.