2016-09-24 4 views
1

mysql CLI에서 내 aws rds mysql 인스턴스에 액세스 할 수 있습니다. 하지만 sailsjs 데이터베이스 어댑터에서는 동일한 구성이 작동하지 않습니다.Sailsjs 어댑터를 사용하여 aws rds를 연결할 수 없습니다.

이 내 ./config/env/production.js

connections: { 
    mysqlServer: { 
     host: "demo.c4a1v1iyi4x1.ap-southeast-1.rds.amazonaws.com", 
     user: "username", 
     password: "password", 
     database: "mydb", 
    }, 
    }, 

이다 나는 돛을 위 구성을 사용하여 테이블

/** 
* Default model configuration 
* (sails.config.models) 
* 
* Unless you override them, the following properties will be included 
* in each of your models. 
* 
* For more info on Sails models, see: 
* http://sailsjs.org/#/documentation/concepts/ORM 
*/ 

module.exports.models = { 

    /*************************************************************************** 
    *                   * 
    * Your app's default connection. i.e. the name of one of your app's  * 
    * connections (see `config/connections.js`)        * 
    *                   * 
    ***************************************************************************/ 
    connection: 'mysqlServer', 

    /*************************************************************************** 
    *                   * 
    * How and whether Sails will attempt to automatically rebuild the   * 
    * tables/collections/etc. in your schema.         * 
    *                   * 
    * See http://sailsjs.org/#/documentation/concepts/ORM/model-settings.html * 
    *                   * 
    * In a production environment (NODE_ENV==="production") Sails always uses * 
    * migrate:"safe" to protect inadvertent deletion of your data.    * 
    * However development has a few other options for convenience:    * 
    *                   * 
    * safe - never auto-migrate my database(s). I will do it myself (by hand) * 
    * alter - auto-migrate, but attempt to keep existing data (experimental) * 
    * drop - wipe/drop ALL my data and rebuild models every time I lift Sails * 
    *                   * 
    ***************************************************************************/ 
    migrate: 'alter', 

}; 

를 만들 내 ./config/models.js를 수정했습니다. js는 연결할 수 없거나 aws rds 인스턴스에서 테이블을 만들 수 없습니다. 누구든지이 도움이 될 수 있습니다. 미리 감사드립니다.

+0

오류 메시지를 표시하십시오. –

+0

안녕하세요. zabware, 오류 메시지가 없습니다. 답장을 보내 주셔서 감사합니다. –

+0

오류가 발생했습니다. Sails.Js는 생산 현장에서 흘수선에 '변경'또는 '낙하'대신 '이주 : 안전'을 사용하도록 강요합니다. 그래서 어떤 테이블 생성도 금지되었습니다. 따라서 'migrate : alter'를 사용하여 개발 구성을 프로덕션으로 대체하고 테이블을 작성했습니다. –

답변

0

오류가 발생했습니다. Sails.Js는 생산 현장에서 흘수선에 '변경'또는 '낙하'대신 '이주 : 안전'을 사용하도록 강요합니다. 그래서 어떤 테이블 생성도 금지되었습니다. 그래서 나는 'migrate : alter'라는 프로덕션으로 개발 구성을 오버라이드하고 돛을 들어 올렸다. 빙고! 모든 테이블이 만들어졌습니다.

돛이 rds와 연결할 수 있었지만 자체 구성에서 테이블을 만들 수 없었습니다.

관련 문제