Answer the question
In order to leave comments, you need to log in
Why don't migrations roll on a combat base?
I am developing a website in Yii2. I use migrations to make changes to the database. Everything works fine on the local machine. But when I try to apply migrations to the battle base (so as not to do everything manually), I get a connection error:
C:\OpenServer\domains\datingsite>yii migrate/up
Yii Migration Tool (based on Yii v2.0.3)
Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [2002] Попытка устано
вить соединение была безуспешной, т.к. от другого компьютера за требуемое время
не получен нужный отклик, или было разорвано уже установленное соединение из-за
неверного отклика уже подключенного компьютера.
'
return [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=mysql4.locum.ru;dbname=***',
'username' => '***',
'password' => '***',
'charset' => 'utf8',
];
Answer the question
In order to leave comments, you need to log in
1) Comment in the bind-address config, if any.
2) GRANT ALL ON *.* to 'user_name'@'some_host' IDENTIFIED BY 'user_password';
Instead of some_host - substitute ip or host from where you want to connect.
The 2nd point is described in more detail in the mysql mana .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question