mysql ipv6 监听参照 https://www.jb51.net/article/133019.htm 这篇文章弄得。Navicat 也可以通过ipv6的账户进行连接C# 程序改怎么写呢这样么 static void Main(string[] args) { using (MySqlConnection conn = new MySqlConnection("server=::1;uid=ipv6test;pwd=root;database=test1;CharSet=utf8"))
{
string sql = "select * from host"; using (MySqlCommand comm = new MySqlCommand(sql, conn))
{
conn.Open(); var reader = comm.ExecuteReader(); if (reader.Read())
{ string host = reader["host"] == System.DBNull.Value ? string.Empty : reader["host"].ToString();
Console.WriteLine(host);
}
reader.Close();
}
}
Console.ReadKey();
}
- 1 回答
- 0 关注
- 712 浏览
添加回答
举报
0/150
提交
取消