Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a big bug in yii2 migrate #10301

Closed
buuug7 opened this issue Dec 2, 2015 · 3 comments
Closed

a big bug in yii2 migrate #10301

buuug7 opened this issue Dec 2, 2015 · 3 comments

Comments

@buuug7
Copy link

buuug7 commented Dec 2, 2015

while your enviroment is build by vagrant virtual machine ,the yii2 migrate will be not work properly,but when you ssh to virtual machine it will be work,the Exception is:

D:\www\data\game4039>yii migrate
Warning: Invalid argument supplied for foreach() in D:\www\data\game4039\vendor\yiisoft\y
ii2\helpers\BaseArrayHelper.php on line 121
Call Stack:
0.0005 127104 1. {main}() D:\www\data\game4039\yii:0
0.0095 912056 2. yii\helpers\BaseArrayHelper::merge() D:\www\data\game4039\yii:
24
Yii Migration Tool (based on Yii v2.0.7-dev)
Exception 'yii\db\Exception' with message 'SQLSTATE[HY000] [2002] 由于目标计算机积极拒绝
,无法连接。
'
in D:\www\data\game4039\vendor\yiisoft\yii2\db\Connection.php:538
Stack trace:
#0 D:\www\data\game4039\vendor\yiisoft\yii2\db\Connection.php(848): yii\db\Connection->op

en()
#1 D:\www\data\game4039\vendor\yiisoft\yii2\db\Connection.php(835): yii\db\Connection->ge

tMasterPdo()
#2 D:\www\data\game4039\vendor\yiisoft\yii2\db\Command.php(218): yii\db\Connection->getSl

avePdo()
#3 D:\www\data\game4039\vendor\yiisoft\yii2\db\Command.php(833): yii\db\Command->prepare(

true)
#4 D:\www\data\game4039\vendor\yiisoft\yii2\db\Command.php(361): yii\db\Command->queryInt

ernal('fetchAll', NULL)
#5 D:\www\data\game4039\vendor\yiisoft\yii2\db\mysql\Schema.php(198): yii\db\Command->que

ryAll()
#6 D:\www\data\game4039\vendor\yiisoft\yii2\db\mysql\Schema.php(97): yii\db\mysql\Schema-

findColumns(Object(yii\db\TableSchema))

7 D:\www\data\game4039\vendor\yiisoft\yii2\db\Schema.php(146): yii\db\mysql\Schema->load

TableSchema('tq_migration')

8 D:\www\data\game4039\vendor\yiisoft\yii2\console\controllers\MigrateController.php(121

): yii\db\Schema->getTableSchema('{{%migration}}', true)

9 D:\www\data\game4039\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.php

(620): yii\console\controllers\MigrateController->getMigrationHistory(NULL)

10 D:\www\data\game4039\vendor\yiisoft\yii2\console\controllers\BaseMigrateController.ph

p(102): yii\console\controllers\BaseMigrateController->getNewMigrations()

11 [internal function]: yii\console\controllers\BaseMigrateController->actionUp(0)

12 D:\www\data\game4039\vendor\yiisoft\yii2\base\InlineAction.php(55): call_user_func_ar

ray(Array, Array)

13 D:\www\data\game4039\vendor\yiisoft\yii2\base\Controller.php(151): yii\base\InlineAct

ion->runWithParams(Array)

14 D:\www\data\game4039\vendor\yiisoft\yii2\console\Controller.php(91): yii\base\Control

ler->runAction('', Array)

15 D:\www\data\game4039\vendor\yiisoft\yii2\base\Module.php(455): yii\console\Controller

->runAction('', Array)

16 D:\www\data\game4039\vendor\yiisoft\yii2\console\Application.php(167): yii\base\Modul

e->runAction('migrate', Array)

17 D:\www\data\game4039\vendor\yiisoft\yii2\console\Application.php(143): yii\console\Ap

plication->runAction('migrate', Array)

18 D:\www\data\game4039\vendor\yiisoft\yii2\base\Application.php(375): yii\console\Appli

cation->handleRequest(Object(yii\console\Request))

19 D:\www\data\game4039\yii(27): yii\base\Application->run()

20 {main}

@lichunqiang
Copy link
Contributor

怎么看像是db没有连接上呢

@samdark
Copy link
Member

samdark commented Dec 2, 2015

You don't have access to DBMS from where you're running migrate. That's not Yii problem but your environment config.

@samdark samdark closed this as completed Dec 2, 2015
@buuug7
Copy link
Author

buuug7 commented Dec 3, 2015

i can be sure my config is not problems,you can have a try with vagrant environment ,the migration really not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants