从品牌网站建设到网络营销策划,从策略到执行的一站式服务
自制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元起,快前往官网查看详情吧
成都网站建设公司地址:成都市青羊区太升南路288号锦天国际A座10层 建设咨询028-86922220
成都快上网科技有限公司-四川网站建设设计公司 | 蜀ICP备19037934号 Copyright 2020,ALL Rights Reserved cdkjz.cn | 成都网站建设 | © Copyright 2020版权所有.
专家团队为您提供成都网站建设,成都网站设计,成都品牌网站设计,成都营销型网站制作等服务,成都建网站就找快上网! | 成都网站建设哪家好? | 网站建设地图