I’m having a strange issue with my database MySql connection, that seems to be failing on one specific occasion.
I’m running a Yii2 framework application (basic) on Xampp on my local machine, using PhpMyAdmin for the MySQL Database.
I’ve got no problem connecting with the db on my site (127.0.0.1:8080/yii-platform/web) or even via “mysql -u root -p”, but my php yii commands in the terminal give an error. So I can’t do any migrations, commands or anything that accesses the database from there (which is why I’ve been creating all my tables with sql queries in PhpMyAdmin).
This is the error message:
The strange thing is that this connection is also using the configuration of the db-connection I have in the Yii app, which is working perfectly on the site. I also know the username and password are correct.
‘class’ => ‘yii\db\Connection’,
‘dsn’ => ‘mysql:host=127.0.0.1;dbname=platformbase;’,
‘username’ => ‘root’,
‘password’ => ‘****’,
‘charset’ => ‘utf8’,
If anyone has an idea what the problem might be, I would be really thankful!