node.js - Create pool using connection string nodejs mysql -
i have been looking way use mysql connection string create pool rather using credentials, can use connection string azure application settings, far not find solution.
i can create pool way:
pool = mysql.createpool({ connectionlimit: 20, host: host, user: user, password: password, database: database, debug: false });
but want achieve this:
pool = mysql.createpool(process.env.mysqlconnstr_connectionstring);
i using module felixge/node-mysql.
i trying connection string provided azure mysql db in format:
database=database;data source=host;user id=userid;password=password
but turns out format not supported , worked when used this:
mysql://userid:password@host/database
Comments
Post a Comment