How do I connect to MySQL through ASP?


When you want to connect to a database from an ASP page, the first step is to create the connection string. This provides information (in the form of parameters and their values) that is required for the server to establish the connection.

DSN-less connection strings: With a DSN-less connection string, you specify all of the required database information in the connection string.


The following example shows a DSN-less connection string for a MySQL database:

 connect_string = "Driver={Mysql};Server=localhost;Port=3306;Database=[database_name];UID=[username];PWD=[password]"

where [database_name] is the name of the database, and [username] and [password] are the username and password required for accessing the database.

  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

How do I create a MySQL database?

Overview MySQL databases allow you to store lots of information in an easy to access manner. The...

How do I delete a MySQL database?

Overview You can easily delete a MySQL database from your web hosting account. Follow the...

How do I create a MySQL database?

Overview There are two primary steps when creating a MySQL user. The first step is to create a...

How do I use phpMyAdmin?

Overview phpMyAdmin is a web based database administration tool specifically for managing MySQL...

How do I setup remote access to my MySQL databases?

Overview Remote MySQL allows external web servers to access your MySQL databases by adding their...