我在通过ssh连接到33060端口的mysql数据库时遇到了问题,我的配置如下:
return [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=myDatabase',
'emulatePrepare' =>true,
'username' => 'user',
'password' => 'password',
'charset' => 'utf8',
];
当我尝试连接时,我已经打开了ssh隧道,但是出现了以下错误:
SQLSTATE[28000] [1045] Access denied for user 'user'@'localhost' (using password: YES)
我做错了什么?在Yii2中是否可以通过ssh连接?
谢谢答复!