官术网_书友最值得收藏!

Editing the config.js file with database credentials

As we can see, the sequelize command creates many files, including a database configuration file. This file has a sample configuration for application databases.

  1. Open config/config.json and edit the development tag with our database details, as the following highlighted code:
          { 
            "development": { 
            "username": "root", "password": "", "database": "mvc_mysql_app", "host": "127.0.0.1", "port": "3306", "dialect": "mysql" 
            }, 
            "test": { 
                "username": "root", 
                "password": null, 
                "database": "database_test", 
                "host": "127.0.0.1", 
                "dialect": "mysql" 
            }, 
            "production": { 
                "username": "root", 
                "password": null, 
                "database": "database_production", 
                "host": "127.0.0.1", 
                "dialect": "mysql" 
            } 
          } 
    

Tip

Note that I'm using user root with no password to connect with my database, if you have a different user or are using a different password, replace the previous code with your own credentials.

主站蜘蛛池模板: 白河县| 浪卡子县| 松潘县| 井陉县| 玉环县| 鸡西市| 临汾市| 富民县| 全南县| 扎兰屯市| 普定县| 鄂伦春自治旗| 定州市| 仪陇县| 股票| 上饶县| 沙河市| 恩平市| 青海省| 南召县| 错那县| 佛山市| 昆明市| 石阡县| 三江| 绥化市| 林西县| 佛山市| 乐至县| 邢台市| 库尔勒市| 铁力市| 阳高县| 漳平市| 宜章县| 梅州市| 广汉市| 金堂县| 兴宁市| 滁州市| 顺义区|