Brinkster Knowledge Base

KB Home   /  Support  /  Database  /  MySQL  /   How do I connect to a MySQL database with ASP
How do I connect to a MySQL database with ASP Articles
** Important information regarding the following code samples. **

All references to "UserName" need to be replaced with your actual Brinkster UserName.
All references to "Password" need to be replaced with your actual Brinkster Password.
All references to server hostnames are not specific. Please log into your account, select the web site settings, and use the hostname shown there.



MySQL:
Important information regarding the MySQL Database code sample.

UserName is case sensitive and must be all lower case.


The server name reference 'mySQLx.Brinkster.com' is not specific:
Your specific mySQL hostname is listed in Website Settings of the account control panel.

<%

Dim dbhost, dbname_and_username, dbpwd, oConn, sConnection

 

dbhost = "mysqlX.brinkster.com"

dbname_and_username = "Brinkster_UserName"

dbpwd = "Brinkster_Password"

 

Set oConn = Server.CreateObject("ADODB.Connection")

sConnection = "Driver={MySQL ODBC 3.51 Driver};" &_

"Server="& dbhost &";uid="& dbname_and_username &";pwd="& dbpwd &";database="& dbname_and_username &";"

oConn.Open(sConnection)

response.write "<br><br><center>The MySQL connection has been opened.<br><br>"

 

oConn.Close

response.write "The MySQL connection has been closed.</center>"

Set oConn = nothing

%>