[C#] Check If MySQL Database Allows Remote Connection

  • Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

Elite_Modz

Active Poster
Retired Staff
Active Member
Console ID Poster
Dec 19, 2014
517
380
133
Crunch
Reference:
Code:
using MySql.Data.MySqlClient;

Add Code 0x01 Here:

Code 0x01:
Code:
  private string conn;
  private MySqlConnection connect;

Download MySql.Data.DLL and install (Project>Add Reference>Browse For this File):

Code:
Code:
private void db_connection()
  {
  try
  {
  string server;
  string database;
  string uid;
  string password;
  server = "";//Database Server
  database = "";//Database Name
  uid = "";//Database Username
  password = "";//Database Password
  string connectionString;
  connectionString = "SERVER=" + server + ";" + "DATABASE=" +
  database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";
  connect = new MySqlConnection(connectionString);
  connect.Open();

  MessageBox.Show("MySQL Database Supports Remote Connection");
  connect.Close();
  }
  catch (MySqlException e)
  {
  throw;
  }
  }
 
Last edited:
General chit-chat
Help Users
    Chat Bot: cleverton47 is our newest member. Welcome!