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

  • Node.js 6.x Blueprints
  • Fernando Monteiro
  • 125字
  • 2021-07-14 10:35:05

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.

主站蜘蛛池模板: 大兴区| 醴陵市| 宁乡县| 南京市| 新泰市| 陕西省| 商南县| 江油市| 龙胜| 荆州市| 德昌县| 海丰县| 武冈市| 宁海县| 建平县| 汶川县| 阳高县| 筠连县| 桃江县| 邯郸市| 乐东| 黔江区| 台南县| 易门县| 隆化县| 新昌县| 通州市| 穆棱市| 盐津县| 巴林左旗| 自治县| 茶陵县| 乐业县| 九龙坡区| 桂平市| 宁化县| 黄大仙区| 奇台县| 隆林| 三台县| 海晏县|