Knex.js 什么';是什么导致knex迁移:最新的可交付性失败?
我正在Shippable上建立CI环境。我有一个测试数据库,我需要对它运行迁移,但我遇到了一个对我来说毫无意义的错误 正在执行的生成步骤如下所示:Knex.js 什么';是什么导致knex迁移:最新的可交付性失败?,knex.js,shippable-ci,Knex.js,Shippable Ci,我正在Shippable上建立CI环境。我有一个测试数据库,我需要对它运行迁移,但我遇到了一个对我来说毫无意义的错误 正在执行的生成步骤如下所示: (cd www && NODE_ENV=test knex --knexfile ./config/knexplus.js migrate:latest) 输出如下: Working directory changed to ~/src/github.com/org/api/www/config Using environment:
(cd www && NODE_ENV=test knex --knexfile ./config/knexplus.js migrate:latest)
输出如下:
Working directory changed to ~/src/github.com/org/api/www/config
Using environment: test
Knex:warning - Pool2 - Error: Pool was destroyed
Knex:Error Pool2 - Error: ER_DBACCESS_DENIED_ERROR: Access denied for user ''@'localhost' to database 'my_test'
Knex:Error Pool2 - Error: ER_DBACCESS_DENIED_ERROR: Access denied for user ''@'localhost' to database 'my_test'
Error: Pool was destroyed
别误会我,我理解这个信息,但不是为什么我会收到它。在运行迁移之前,我让构建转储knexplus.js
文件内容:
(cd www && cat ./config/knexplus.js)
'use strict';
exports.vagrant = exports.staging = exports.production = {
client: 'mysql',
connection: {
host: '127.0.0.1',
port: '3306',
user: 'shippable',
password: '',
database: 'mine',
timezone: 'UTC',
charset: 'utf8',
debug: false
},
migrations: {
tableName: '_migrations',
directory: '../db/migrations'
},
seeds: {
directory: '../db/seeds'
}
};
exports.test = {
client: 'mysql',
connection: {
host: '127.0.0.1',
port: '3306',
user: 'shippable',
password: '',
database: 'my_test',
timezone: 'UTC',
charset: 'utf8',
debug: false
},
migrations: {
tableName: '_migrations',
directory: '../db/migrations'
},
seeds: {
directory: '../db/seeds'
}
};
我注意到错误消息似乎表明我们正在获取正确的配置,因为它引用了my_test
数据库,但是用户名和主机是错误的
你知道我在这里遗漏了什么吗?我最后输入了一张支持票,得到了以下回复: 新默认映像中的数据库没有“可交付”用户,因此MySQL注意到有人试图以不存在的用户身份进行连接,并尝试查看您是否可以不使用用户名进行连接。您可以通过添加
mysql-e“GRANT ALL ON*.*来创建一个可交付用户shippable@localhost在连接或以根用户身份连接之前,由“;刷新权限;”“
标识到ci
部分中的shippable.yml
我当时阅读的所有文档都有可交付的用户。我想,第一步是找到正确的文档