I’ve registered a free online host and imported the tables from localhost database, then the PDOException happened after login. The application is working fine with localhost database. I don’t know if the problem comes from the user table, it is the default user model and created by yii migrate.
As the error message suggests, you should look at yii\db\Connection.php line 646.
It’s probably in the createPdoInstance() method:
If your server does have php_pdo installed, you might need to adjust $this->dsn, $this->username and $this->password according to your production environment. Check your config/db.php.