{"id":2122,"date":"2020-06-09T02:53:14","date_gmt":"2020-06-08T18:53:14","guid":{"rendered":"https:\/\/www.wesbytes.com\/guide\/?post_type=kb&#038;p=2122"},"modified":"2026-01-09T17:24:09","modified_gmt":"2026-01-09T09:24:09","slug":"connection-strings-for-mysql","status":"publish","type":"kb","link":"https:\/\/www.servergigabit.com\/guide\/kb\/connection-strings-for-mysql","title":{"rendered":"Connection Strings for MySQL"},"content":{"rendered":"<h4 dir=\"ltr\"><strong>Connection Strings for MySQL<\/strong><\/h4>\n<p dir=\"ltr\"><strong>Cold Fusion (DNSless):<\/strong><br \/>\n<span id=\"lblArticle_Article\">connectstring=\u201dDriver={<a href=\"https:\/\/www.mysql.com\/\" rel=\"nofollow noopener\" target=\"_blank\">MySQL<\/a> ODBC 3.51 Driver};SERVER=serverIP;UID=user;PWD=pass;DATABASE=mydb;network=dbmssocn\u201d<\/span><\/p>\n<p dir=\"ltr\">OR<\/p>\n<p dir=\"ltr\"><span id=\"lblArticle_Article\">connectstring=\u201dDriver={MySQL ODBC 5.1 Driver};SERVER=serverIP;UID=user;PWD=pass;DATABASE=mydb;network=dbmssocn\u201d<\/span><\/p>\n<p><strong>Cold Fusion (DNS):<\/strong><br \/>\n<span id=\"lblArticle_Article\">datasource=\u201dDSN\u201d username=\u201duser\u201d password=\u201dpass\u201d<\/span><\/p>\n<p><span id=\"lblArticle_Article\"><strong>Perl (DSNless):<\/strong><br \/>\n$dbh = DBI-&gt;connect(\u2018dbi:mysql:mydatabase:serverIP\u2019,\u2019user\u2019,\u2019pass\u2019);<\/span><\/p>\n<p><strong>PHP (DSNless):<\/strong><br \/>\n$db = mysql_connect(\u201cserverIP\u201d, \u201cuser\u201d, \u201cpass\u201d)<\/p>\n<p><strong>ASP (DSN):<\/strong><br \/>\nMyConn.Open \u201cdsn\u201d<\/p>\n<p><strong>ASP (DSNless):<\/strong><br \/>\n\u201cDriver={MySQL ODBC 3.51 Driver};\u201d &amp; _<br \/>\n\u201cServer=serverIP;\u201d &amp; _<br \/>\n\u201cPort=3306;\u201d &amp; _<br \/>\n\u201cOption=131072;\u201d &amp; _<br \/>\n\u201cStmt=;\u201d &amp; _<br \/>\n\u201cDatabase=mydatabase;\u201d &amp; _<br \/>\n\u201cUid=user;\u201d &amp; _<br \/>\n\u201cPwd=pass\u201d<\/p>\n<p>&nbsp;<\/p>\n<p><em>Please refer to the following article to know more.\u00a0<\/em><br \/>\n<strong>Knowledge Base: <\/strong><a href=\"https:\/\/www.servergigabit.com\/guide\/kb\/does-your-server-support-mysql-front\/\">Does your server support MySQL Front?<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Connection Strings for MySQL Cold Fusion (DNSless): connectstring=\u201dDriver={MySQL ODBC 3.51 Driver};SERVER=serverIP;UID=user;PWD=pass;DATABASE=mydb;network=dbmssocn\u201d OR connectstring=\u201dDriver={MySQL ODBC 5.1 Driver};SERVER=serverIP;UID=user;PWD=pass;DATABASE=mydb;network=dbmssocn\u201d Cold Fusion (DNS): datasource=\u201dDSN\u201d username=\u201duser\u201d password=\u201dpass\u201d Perl (DSNless): $dbh = DBI-&gt;connect(\u2018dbi:mysql:mydatabase:serverIP\u2019,\u2019user\u2019,\u2019pass\u2019); PHP (DSNless): $db = mysql_connect(\u201cserverIP\u201d, \u201cuser\u201d, \u201cpass\u201d) ASP (DSN): MyConn.Open \u201cdsn\u201d ASP (DSNless): \u201cDriver={MySQL ODBC 3.51 Driver};\u201d &amp; _ \u201cServer=serverIP;\u201d &amp; _ \u201cPort=3306;\u201d &amp; _ \u201cOption=131072;\u201d &amp; _ \u201cStmt=;\u201d &amp; _ \u201cDatabase=mydatabase;\u201d &amp;&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"kbtopic":[51],"kbtag":[1292,1215],"class_list":["post-2122","kb","type-kb","status-publish","hentry","kbtopic-mysql","kbtag-connection-string","kbtag-mysql"],"_links":{"self":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/2122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/comments?post=2122"}],"version-history":[{"count":5,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/2122\/revisions"}],"predecessor-version":[{"id":5711,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kb\/2122\/revisions\/5711"}],"wp:attachment":[{"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/media?parent=2122"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=2122"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.servergigabit.com\/guide\/wp-json\/wp\/v2\/kbtag?post=2122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}