try the obligatory localhost or 127.0.0.1 instead of that? worth a shot if anything..
Mysql isn't running on the localhost, app and database are hosted on separate hosts.
can you connect from the command line with the info from the .env to the DB server? Is there anything set in the config/database?
from command line it connects fine, running the command php artisan migrate --seed works great
although php artisan migrate:refresh -seed returns an exception, it doesn't seem to find the migration php files (¿?)
in config/database.php there is this:
'fetch' => PDO::FETCH_ASSOC,
'default' => env('DB_CONNECTION', 'mysql'),
'connections' => [
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '10.1.220.251'),
'database' => env('DB_DATABASE', 'database'),
'username' => env('DB_USERNAME', 'user'),
'password' => env('DB_PASSWORD', 'password'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
Did you ever get this figured out? I'm having the exact same issue when moving my project from local dev to dev server. Can migrate, can interact with models in artisan tinker, but can't use a model from any controller or route without a PDO exception, and I had to wrap it in a try/catch to be able to see that much...
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community