P
P
phpForeve2017-06-12 01:11:52
Yii
phpForeve, 2017-06-12 01:11:52

Error in yii2 migrate. How to decide?

Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [2002] ╧юфъы■ўхэшх эх єёЄрэютыхэю, Є.ъ. ъюэхўэ√щ ъюья№■ЄхЁ юЄтхЁу чряЁюё эр яюфъы■ўхэшх.                                   
'                                                                                                                                                                                     
                                                                                                                                                                                      
in D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\db\Connection.php:568                                                                                                   
                                                                                                                                                                                      
Stack trace:                                                                                                                                                                          
#0 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\db\Connection.php(896): yii\db\Connection->open()                                                                       
#1 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\db\Connection.php(883): yii\db\Connection->getMasterPdo()                                                               
#2 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\db\Command.php(219): yii\db\Connection->getSlavePdo()                                                                   
#3 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\db\Command.php(896): yii\db\Command->prepare(true)                                                                      
#4 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\db\Command.php(362): yii\db\Command->queryInternal('fetchAll', NULL)                                                    
#5 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\db\mysql\Schema.php(199): yii\db\Command->queryAll()                                                                    
#6 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\db\mysql\Schema.php(98): yii\db\mysql\Schema->findColumns(Object(yii\db\TableSchema))                                   
#7 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\db\Schema.php(152): yii\db\mysql\Schema->loadTableSchema('migration')                                                   
#8 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\console\controllers\MigrateController.php(199): yii\db\Schema->getTableSchema('{{%migration}}', true)                   
#9 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php(207): yii\console\controllers\MigrateController->getMigrationHistory(1)   
#10 [internal function]: yii\console\controllers\BaseMigrateController->actionDown(1)                                                                                                 
#11 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)                                                          
#12 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\base\Controller.php(156): yii\base\InlineAction->runWithParams(Array)                                                  
#13 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\console\Controller.php(128): yii\base\Controller->runAction('down', Array)                                             
#14 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\base\Module.php(523): yii\console\Controller->runAction('down', Array)                                                 
#15 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\console\Application.php(180): yii\base\Module->runAction('migrate/down', Array)                                        
#16 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\console\Application.php(147): yii\console\Application->runAction('migrate/down', Array)                                
#17 D:\OpenServer\domains\pervomay-vue\api\vendor\yiisoft\yii2\base\Application.php(380): yii\console\Application->handleRequest(Object(yii\console\Request))                         
#18 D:\OpenServer\domains\pervomay-vue\api\yii(20): yii\base\Application->run()                                                                                                       
#19 {main}

I created a migration - I'm trying to roll, such a bug got out.
PS The connection to the database is established, I receive, create, edit and delete data without any problems.
'

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Fedorov, 2017-06-12
@qonand

Error 2002 indicates that the application was unable to connect to the database. Check the settings of the application responsible for migrations

O
Olga, 2017-09-29
@kaily6

Yes, the problem is in connecting to the database.
Check that the database exists and access to it is valid.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question