-2

I tried hosting my Laravel App using Laravel Version 4 On Godaddy and it worked wel, but when I tried logging in, I got this error message:

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38)

NOTE A DUPLICATE: All the Answers there kept pointing to Installing MySQL and mostly referring to this issue on a localhost/System while mine is on a Live server and has nothing to do with MySQL

0

1 Answer 1

2

Okay I finally found the issue, If you ever encounter this on Godaddy, kindly check your Database configuration file in database.php, instead of localhost for the Host, you have to use Godaddy's Host for your Database.

So instead of this:

'mysql' => array(
            'driver'    => 'mysql',
            'host'      => 'localhost',
            'database'  => 'revailment',
            'username'  => 'revailment',
            'password'  => 'password',
            'charset'   => 'utf8',
            'collation' => 'utf8_unicode_ci',
            'prefix'    => '',
        ),

Your configuration should be like this:

    'mysql' => array(
        'driver' => 'mysql',
        'host' => 'revailment.db.9860920.hostedresource.com',
        'database' => 'revailment',
        'username' => 'revailment',
        'password' => 'password',
        'charset' => 'utf8',
        'collation' => 'utf8_unicode_ci',
        'prefix' => '',
    ),

Am hoping that this will also be of help to anyone who may encounter such issue in the Future.

Not the answer you're looking for? Browse other questions tagged or ask your own question.