[support] [solved] Can't change database connection

Tim Johnson tim at akwebsoft.com
Thu Jan 3 21:07:59 UTC 2013


* Tim Johnson <tim at akwebsoft.com> [130102 15:33]:
> * Tim Johnson <tim at akwebsoft.com> [130102 10:15]:
> Two steps are needed:
> 1) Define connection information as an entry in settings.php to the
> $databases array as follows:
> 
> 'dba' => array (
>     'default' => array (
>         'driver' => 'mysql',
>         'database' => 'aisbooks',
>         'host' => 'localhost',
>         'username' => 'tim',
>         'password' => 'marion',
>         // explicitly define the socket file for mysql
>         'unix_socket' => '/opt/local/var/run/mysql5/mysqld.sock',
>     ),
> ),
> 
> 
> The default setting in php.ini for pdo_mysql.default_socket
> is /tmp/mysql.sock - which works for non-drupal PHP, but
> I had to create a soft link for the 'unix_socket' value above,
> as is explained in the document above.

  I should add here, that when I went to install drupal 'by hand',
  rather than using the bitnami stack installer, I ran into a
  problem installing the 'by hand' version of drupal with mysql. 
  
  I got error messages saying that drupal could not resolve or read
  /tmp/mysql.sock. 
  
  Setting up the softlink at
  /opt/local/var/run/mysql5/mysqld.sock solves this problem.

  That value has to be changed in php.ini
  code :
  pdo_mysql.default_socket=/opt/local/var/run/mysql5/mysqld.sock
  and restart apache.

  Changing the pdo_mysql.default_socket value does not seem to
  affect the operation of non-drupal PHP, phpinfo and phpmyadmin et.
  al.

  To clarify: installing drupal 'by hand' is to copy the contents of
  the downloaded and untarred drupal package to some path recognized
  by apache (beneath whatever is set as apache's doc root) and then
  pointing the browser to it...

-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com


More information about the support mailing list