myks92
@myks92
Нашёл решение — пометь вопрос ответом!

Как исправить ошибку в миграции?

Миграции выдает кучу ошибок. Я так понимаю проблема в базе данных, но связь есть. Всё остальное работает

Yii Migration Tool (based on Yii v2.0.12)

Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [2002] Operation timed out'

in /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/db/Connection.php:584

Stack trace:
#0 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/db/Connection.php(928): yii\db\Connection->open()
#1 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/db/Connection.php(915): yii\db\Connection->getMasterPdo()
#2 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/db/Command.php(219): yii\db\Connection->getSlavePdo()
#3 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/db/Command.php(910): yii\db\Command->prepare(true)
#4 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/db/Command.php(362): yii\db\Command->queryInternal('fetchAll', NULL)
#5 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/db/mysql/Schema.php(199): yii\db\Command->queryAll()
#6 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/db/mysql/Schema.php(98): yii\db\mysql\Schema->findColumns(Object(yii\db\TableSchema))
#7 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/db/Schema.php(152): yii\db\mysql\Schema->loadTableSchema('migration')
#8 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/console/controllers/MigrateController.php(194): yii\db\Schema->getTableSchema('{{%migration}}', true)
#9 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(814): yii\console\controllers\MigrateController->getMigrationHistory(NULL)
#10 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/console/controllers/BaseMigrateController.php(155): yii\console\controllers\BaseMigrateController->getNewMigrations()
#11 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)
#12 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#13 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/base/Controller.php(156): yii\base\InlineAction->runWithParams(Array)
#14 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/console/Controller.php(128): yii\base\Controller->runAction('', Array)
#15 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/base/Module.php(523): yii\console\Controller->runAction('', Array)
#16 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/console/Application.php(180): yii\base\Module->runAction('migrate', Array)
#17 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/console/Application.php(147): yii\console\Application->runAction('migrate', Array)
#18 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/vendor/yiisoft/yii2/base/Application.php(380): yii\console\Application->handleRequest(Object(yii\console\Request))
#19 /Users/maksimvorozcov/.bitnami/stackman/machines/xampp/volumes/root/htdocs/orto/yii(27): yii\base\Application->run()
#20 {main}
MBP-Maksim:orto maksimvorozcov$ php -i | grep Configuration
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini
Configuration
PHP Warning: Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
MBP-Maksim:orto maksimvorozcov$
  • Вопрос задан
  • 121 просмотр
Решения вопроса 1
webinar
@webinar Куратор тега Yii
Учим yii: https://youtu.be/-WRMlGHLgRg
Судя по
please set date.timezone
Надо установить timezone, видимо в бд.
Ответ написан
Комментировать
Пригласить эксперта
Ответы на вопрос 1
Maksclub
@Maksclub
maksfedorov.ru
Проверьте пароль и логин
попробуйте в консоли подключиться со своими паролями и логинами к MySQL
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы