덤프파일 만들기
mysqldump-u'root' -p'password' DBNAME> 20200129.sql
덤프 파일 복원
mysql -u'root' -p'password' DBNAME < 20200129.sql
덤프파일 만들기
mysqldump-u'root' -p'password' DBNAME> 20200129.sql
덤프 파일 복원
mysql -u'root' -p'password' DBNAME < 20200129.sql
string connectionString =
"Server=127.0.0.1;" +
"Database=test;" +
"User ID=root;" +
"Password=password;" +
"Pooling=false";
IDbConnection dbcon;
dbcon = new MySqlConnection(connectionString);
dbcon.Open();
IDbCommand dbcmd = dbcon.CreateCommand();
string sql ="SELECT * FROM mamber";
dbcmd.CommandText = sql;
IDataReader reader = dbcmd.ExecuteReader();
while(reader.Read()) {
string FirstName = reader[name].ToString();
Console.WriteLine("Name: " + FirstName);
}
reader.Close();
reader = null;
dbcmd.Dispose();
dbcmd = null;
dbcon.Close();
dbcon = null;
| c# 크로스 스레드 (0) | 2020.01.29 |
|---|---|
| c# ping test (0) | 2020.01.29 |
| C# ListView 선택된 아이템 가져오기 (0) | 2020.01.29 |
| c# Mysql (0) | 2020.01.29 |
| c# MessageBox 예 아니오 선택 (0) | 2020.01.29 |
private static MySqlConnection mySqlConn; //선언
public static void DBConn()
{
//연결
try
{
string strconn = "Server=127.0.0.1;Database=test;Uid=root;Pwd=apmsetup;";
mySqlConn = new MySqlConnection(strconn);
mySqlConn.Open();
}
catch (Exception ex)
{
Console.WriteLine("연결 실패\n인터넷 연결을 확인해주세요\n" + ex.Message);
}
finally
{
}
}
public static MySqlConnection getInsent()
{
if (mySqlConn == null || mySqlConn.State != System.Data.ConnectionState.Open || mySqlConn.Ping() == false)
{
DBConn();
Console.WriteLine("DB재연결");
}
return mySqlConn;
}
public void sendMSG()
{
try
{
// MYSQL 내보내기
string msg = "SELECT * FROM member WHERE Idx = 1;";
// MYSQL 내보내기
// 날릴 쿼리가 있으면
string str = "";
if (!(msg == ""))
{
using (MySqlCommand count = new MySqlCommand(msg, mySqlConn))
{
//count.ExecuteNonQuery();
MySqlDataReader myCount = count.ExecuteReader();
while (myCount.Read())
{
str = myCount["Name"].ToString();
}
myCount.Close();
}
}
}
catch (Exception ex)
{
Console.WriteLine("READ Error!\n" + ex.Message);
}
finally
{
}
}| monodevelop Mysql (0) | 2020.01.29 |
|---|---|
| C# ListView 선택된 아이템 가져오기 (0) | 2020.01.29 |
| c# MessageBox 예 아니오 선택 (0) | 2020.01.29 |
| c# textbox 비밀번호 (0) | 2020.01.29 |
| c# ini (0) | 2020.01.29 |