HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

MySQL connection string using password

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
passwordmysqlusingstringconnection

Problem

I am creating app with ExpressJS and want to use MySQL with password, but I have problem with connection string

mysql://user@localhost:3306/db

in this string where to specify password to connect to db

Please help me

Solution

You looking for Uniform Resource Identifier (URI) scheme, and the syntax is:

mysql://username:password@host:port/database/tablename


See the MySQL documentation

Code Snippets

mysql://username:password@host:port/database/tablename

Context

StackExchange Database Administrators Q#147672, answer score: 7

Revisions (0)

No revisions yet.