Can't connect to my DB server


I just installed Yii2 basic template.

I try to connect to my database server that is so the db.php is like this:


return [

    'class' => 'yii\db\Connection',

    'dsn' => ';dbname=mydbname',

    'username' => 'myuser',

    'password' => 'mypwd',

    'charset' => 'utf8',


But when i open Gii the error is

SQLSTATE[HY000] [1045] Access denied for user 'myuser'@'' (using password: YES)

where is the name of the FTP server and not the name of the DB server…

It probably has to do some with your database authentication. Please check if you have any host access restrictions on your mysql database.