Mondoze Knowledge Base

Search our articles or browse by category below

Connection Strings for MySQL

Last modified: October 7, 2022
You are here:
Estimated reading time: < 1 min

Connection Strings for MySQL

Cold Fusion (DNSless):
connectstring=”Driver={MySQL ODBC 3.51 Driver};SERVER=serverIP;UID=user;PWD=pass;DATABASE=mydb;network=dbmssocn”

OR

connectstring=”Driver={MySQL ODBC 5.1 Driver};SERVER=serverIP;UID=user;PWD=pass;DATABASE=mydb;network=dbmssocn”

Cold Fusion (DNS):
datasource=”DSN” username=”user” password=”pass”

Perl (DSNless):
$dbh = DBI->connect(‘dbi:mysql:mydatabase:serverIP’,’user’,’pass’);

PHP (DSNless):
$db = mysql_connect(“serverIP”, “user”, “pass”)

ASP (DSN):
MyConn.Open “dsn”

ASP (DSNless):
“Driver={MySQL ODBC 3.51 Driver};” & _
“Server=serverIP;” & _
“Port=3306;” & _
“Option=131072;” & _
“Stmt=;” & _
“Database=mydatabase;” & _
“Uid=user;” & _
“Pwd=pass”

Was this article helpful?
Dislike 0
Views: 78