Search code examples
fuelphp

Fuelphp's Oil refine migrate command is failing


after a clean install of Fuel, I set the database configuration in the app config file, but after I run oil refine migrate I get

fuelphp oil refine migrate Error - invalid data source name in COREPATH/classes/database/pdo/connection.php on line 87

this problem just started happening and I have no idea what's wrong. it's not the settings in the config file....


Solution

  • This error happens when a connection couldn't be established. In some cases you'll need to have the the host set to 127.0.0.1, this all depends on your dev setup.
    If you're running MAMP you can also alias the MySQL socket like so:

    $ sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
    

    As the troubleshooting section describes sometimes you need to create the MySQL directory first:

    $ sudo mkdir /var/mysql
    $ sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock