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)
mydatabase
doesnt exist. It's not saying the connection settings are wrong soDB_HOST
andDB_PORT
are not where the problem is. If you run aCREATE SCHEMA mydatabase;
would it work? - apokryfosSELECT SUM(TABLE_ROWS) FROM Information_schema.tables WHERE table_schema = 'mydatabase';
says there are ~1,300 rows. My company has a working OctoberCMS install on a prod server - I'm trying to connect to a local install of OctoberCMS that connects to the prod DB. I can connect to it fine using the mysql CLI client (as the SQL query I just provided demonstrates) - I just can't seem to connect usingDB::connection()->getPdo()
... - neubert