mirror of
https://github.com/claunia/marechai.git
synced 2025-12-16 19:14:25 +00:00
Added MySQL connection.
This commit is contained in:
22
cicm_web/Database/Mysql.cs
Normal file
22
cicm_web/Database/Mysql.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using MySql.Data.MySqlClient;
|
||||
|
||||
namespace cicm_web.Database
|
||||
{
|
||||
public class Mysql
|
||||
{
|
||||
MySqlConnection connection;
|
||||
|
||||
public Mysql(string server, string user, string database, ushort port, string password)
|
||||
{
|
||||
string connectionString =
|
||||
$"server={server};user={user};database={database};port={port};password={password}";
|
||||
|
||||
connection = new MySqlConnection(connectionString);
|
||||
}
|
||||
|
||||
~Mysql()
|
||||
{
|
||||
connection?.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user