I am trying to connect to my phpMyAdmin database called "db", but I am getting the following error:
username@servername:~$ mysql -u username -p password
Enter password: (I enter my password)
ERROR 1044 (42000): Access denied for user 'username'@'localhost' to database 'password'
I am pretty sure that my username and password are correct, and that I have the privileges to access the database. What's confusing me is this part:
database 'password'
since that's not the name of my database. The db.php file looks like this:
<?php
return [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=db',
'username' => 'username',
'password' => 'password',
'charset' => 'utf8',
'tablePrefix' => 'uni_',
];
-ppassword, without space. In your case you are trying to connect to database "password" and assume that you will input password from keyboard. - Michael