Page 1 of 1

Problems connecting to db, suddenly (not new install)

Posted: Tue Jun 17, 2008 8:34 pm
by dnlninja
I've had s9y installed for a quite a long time, but lately it seem to be getting errors connecting to my db. My webmaster claims he has changed nothing, and I have not either.
I still think its on his end, but I wanted to get a second opinion before I blame him. Thanks!
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/law/public_html/s9y/include/db/mysql.inc.php on line 270

Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111) in /home/law/public_html/s9y/include/db/mysql.inc.php on line 271

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/law/public_html/s9y/include/db/mysql.inc.php on line 271

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/law/public_html/s9y/include/db/mysql.inc.php on line 281

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/law/public_html/s9y/include/db/mysql.inc.php on line 281
serendipity error: unable to connect to database - exiting.

Re: Problems connecting to db, suddenly (not new install)

Posted: Wed Jun 18, 2008 10:37 am
by garvinhicking
Hi!

Something definitely must have changed in either your PHP or MySQL setup. Seems like your MySQL no longer accepts socket connections but only IP-based ones. So either you restore proper socket connections by configuring the MySQL server and the php.ini options for the socket location, or you might need to edit your serendipity_config_local.inc.php file and replace the database host to the IP address of the server instead of something like "localhost" which it currently might point to.

Best regards,
Garvin

Posted: Wed Jun 18, 2008 8:06 pm
by dnlninja
Thank you very much. I will look into that.

Is my serendipity_config_local.inc file suppose to be blank? The only file I have information in is serendipity_config.inc.php

Posted: Thu Jun 19, 2008 11:25 am
by garvinhicking
Hi!

No, that file must contain information on how s9y can acces your database. It should look something like this:

Code: Select all

<?php
        /*
          Serendipity configuration file
          Written on Tue, 17 Jun 2008 14:01:00 +0200
        */

        $serendipity['versionInstalled']  = '1.4-alpha1';
        $serendipity['dbName']            = 'serendipity';
        $serendipity['dbPrefix']          = 'serendipity10_';
        $serendipity['dbHost']            = '127.0.0.1';
        $serendipity['dbUser']            = 'root';
        $serendipity['dbPass']            = 'root';
        $serendipity['dbType']            = 'mysql';
        $serendipity['dbPersistent']      = false;
        $serendipity['dbCharset']         = 'utf8';

        // End of Serendipity configuration file
        // You can place your own special variables after here:
$serendipity['expose_s9y'] = true;
$serendipity['useHTTP-Auth'] = false;
?>
Regards,
Garvin