mercredi 20 janvier 2021

octobercms can't connect to DB; .env is fine and php artisan tinker / echo env('DB_*') outputs correct content

I'm using OctoberCMS and, using the DB settings in the .env file I can connect to the DB without issue and I see a database named "mydatabase". BUT when I do php artisan tinker and do DB::connection()->getPdo(); I get the following:

InvalidArgumentException with message 'Database (mydatabase) does not exist.'

When I do echo env('DB_HOST'); and echo env('DB_PORT'); etc (for DB_DATABASE, DB_USERNAME and DB_PASSWORD) everything looks good. I can connect with those parameters with the mysql CLI command. And yet DB::connection()->getPdo(); is failing.

Any ideas?

I'm running OctoberCMS 1.0.443. tail -f /path/to/myproject/storage/logs/system.log doesn't return anything (despite being writable)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire