MySql自制服务器-创新互联
自制mysql服务器的关键程序,把这段程序放到线程中运行就可以开启mysql服务了。需要的同学可以参考下。
private void runMysql()
{
Process p=new Process();
string constr="server=localhhost;port=3306;database=dbname;user=root;password='123456';";
MySqlConnection con=new MySqlConnection(constr);
p.StartInfo.FileName="cmd.exe";
p.StartInfo.UseShellExecute=false;
p.StartInfo.RedirectStandardInput=true;
p.StartInfo.RedirectStandardOutput=true;
p.StartInfo.RedirectStandardError=true;
p.StartInfo.CreateNoWindow=true;
p.Start();
//mysql执行文件的位置
string spath="c:\\users\\...\\mysql\\bin\\mysqld.exe";
System.IO.StreamWriter sw=p.StandardInput;
sw.WriteLine(spath);
sw.Flush();
p.StandardInput.WriteLine("exit");
//线程中显示信息需要用到委托,具体参考FillComboBoxCallback
ShowMessage("Mysql在初始化...");
while(Process.GetProcessNyName(&
你是否还在寻找稳定的海外服务器提供商?创新互联www.cdcxhl.cn海外机房具备T级流量清洗系统配攻击溯源,准确流量调度确保服务器高可用性,企业级服务器适合批量采购,新人活动首月15元起,快前往官网查看详情吧
文章名称:MySql自制服务器-创新互联
URL网址:http://ybzwz.com/article/djeghi.html