Why I can't connect to database?

Hello I write in config/db.php this code:


return [

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

    'dsn' => 'mysql:host=localhost;dbname=name',

    'username' => 'user',

    'password' => 'pass',

    'charset' => 'utf8',

    'tablePrefix' => 'sel_',

];

user, pass and dbname without mistakes.

User have got all priviligies to this database (I create and check it into hosting cpanel)

I allready try to create another db with another user and I have got the same error.

On this hosting customer have got another project. I saw their config.

There is localhost, and port is null - all looks, like mysql work with standart port and db is on this localhost. So, problem is not in remote database too.

phpinfo() pdo have got PDO driver, problem is not here too.

But I have got yii2 error:

What I doing wrong? What I must to do?

Same problem here. Anyone?