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(); }
桃花长相依
相关分类