Specifying password in MySQL connection string
Password and DB name also a part of connection string.
Ex: mysql://root:password@localhost:port/dbName
Here's generic connection-string parser, which offers a flexible optional syntax, while adhering to the URL syntax. Works in any environment.
const { ConnectionString } = require('connection-string');
const cs = new ConnectionString('mysql://user:password@host:port/dbName');