C
C
Crash2015-05-31 09:48:31
Yii
Crash, 2015-05-31 09:48:31

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] Попытка устано
вить соединение была безуспешной, т.к. от другого компьютера за требуемое время
не получен нужный отклик, или было разорвано уже установленное соединение из-за
неверного отклика уже подключенного компьютера.
'

Moreover, the site itself works with the database normally - no errors occur during requests. The only problem is with migrations.
The database connection file looks like this:
return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=mysql4.locum.ru;dbname=***',
    'username' => '***',
    'password' => '***',
    'charset' => 'utf8',
];

What can be wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kompi, 2015-05-31
@Bandicoot

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 .

S
Sergey, 2015-05-31
@TsarS

I may be wrong, but if you put 127.0.0.1 as the base address?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question