Skip to content

Instantly share code, notes, and snippets.

@junwatu
Last active August 29, 2015 13:59
Show Gist options
  • Save junwatu/10804657 to your computer and use it in GitHub Desktop.
Save junwatu/10804657 to your computer and use it in GitHub Desktop.
Laravel 4 Tips & Troubleshooting
**1.** Artisan migrate or db:seed error because of false mysql.sock config
**Problem:**
Command `artisan migrate` or `artisan db:seed` have this error message
[PDOException] SQLSTATE[HY000] [2002] No such file or directory
**Solution:**
Type this command
php -i | grep pdo
Will output like this
pdo_mysql.default_socket => /tmp/mysql.sock => /tmp/mysql.sock
check in `/etc/my.cnf` the sock file is actually in
/var/run/mysqld/mysqld.sock.
So,edit php.ini and set the value for `pdo_mysql.default_socket` to
pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock
**2.** ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment