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

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.

主站蜘蛛池模板: 台州市| 宁乡县| 陵水| 沐川县| 嘉义市| 准格尔旗| 鹰潭市| 濮阳县| 长武县| 轮台县| 牟定县| 留坝县| 贵阳市| 海南省| 巢湖市| 广汉市| 张家川| 呼玛县| 建昌县| 张家川| 廉江市| 寿光市| 邯郸县| 青铜峡市| 潢川县| 抚顺县| 永昌县| 龙山县| 德州市| 绵阳市| 南平市| 黄龙县| 高阳县| 祁门县| 鄂温| 巴彦淖尔市| 盘山县| 文安县| 万安县| 台前县| 海阳市|