WebsiteKnowledge Base

How to use MySQL on Windows?

ASP Connection String:
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Driver=MySQL;server=database_host;database=database_name;uid=database_username;pwd=database_password;OPTION=16386"
objConn.Open


.NET Example: using System;
using System.Data;

using MySql.Data;
using MySql.Data.MySqlClient;

public class Tutorial1 {
  public static void Main() {
    string connStr = "server=database_host;user=database_username;database=database_name;port=3306;password=database_password;";
    MySqlConnection conn = new MySqlConnection(connStr);
    try {
      conn.Open();
      // Perform database operations
    } catch (Exception ex) {
      // Handle Errors
    }
    conn.Close();
  }
}