WebFaction
Community site: login faq

I saw another post where seanf says

"You should be able to override those via your Drupal DB connection settings or via local PHP settings in your Drupal app's directory."

I tried everything but cannot get Drupal to use my local install of MySql in $HOME/mysql for installing Drupal with install.php. I get an error message on the DB config page --

"Failed to connect to your database server. The server reports the following message: SQLSTATE[28000] [1045] Access denied for user 'drupuser'@'localhost' (using password: YES)."

I created the database/schema in my local MySql and ran the GRANT command for the drupuser. I also was able to login and USE the database in mysql interactive. I created php.ini in the drupal directory and modified settings.php in the site/default directory. The changes in php.ini show in phpinfo() in the mysql.* settings but it still shows /var/lib/mysql/mysql.sock in the MYSQL_SOCKET setting. ( it needs to be $HOME/mysql/mysql.sock)

How do I make this work?

Thanks

asked 17 Mar '11, 23:13

barrettlee
26126
accept rate: 0%

edited 17 Mar '11, 23:15

Hi,

Did you put "mysql.default_socket= /home/yourusername/mysql/mysql.sock" in your php.ini?

If so could you try specifying the port you run MySQL in Drupal settings?

(17 Mar '11, 23:30) neeravk

My php.ini has : mysql.default_socket=/home/username/mysql/mysql.sock

mysql.default_host=localhost

mysql.default_port=myportnum

mysql.default_user=drupaluser

mysql.default_password=password

my site/default/settings.php has:

$databases = array ( 'default' => array ( 'default' => array ( 'database' => 'dbname', 'username' => 'drupaluser', 'password' => 'password', 'host' => 'localhost', 'port' => 'myportnum', 'driver' => 'mysql', 'prefix' => '', ), ), ); Is there something that I need to restart so the settings take effect? Thanks

(18 Mar '11, 08:58) barrettlee

No, there is nothing special you need to restart - the settings should kick in right away.

(18 Mar '11, 10:00) tie

Got it! based on includes/database/mysql/database.inc I modified my settings.php file and added the unix_socket setting and removed the location and port settings.

  'unix_socket' => '/home/username/mysql/mysql.sock',
  'database' => 'drupdb',
  'username' => 'drupaluser',
  'password' => 'thepassword',
  'driver' => 'mysql',
  'prefix' => '',

Then when I did www.mysite.com/install.php it went right through without prompting for database connection info.

permanent link

answered 18 Mar '11, 11:43

barrettlee
26126
accept rate: 0%

Glad to hear you got it working.

(18 Mar '11, 12:15) johns
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×168
×63
×7

question asked: 17 Mar '11, 23:13

question was seen: 22,069 times

last updated: 18 Mar '11, 12:15

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM