1.複製一份MySQL服務文件,放入一個路徑mysql
2.清理data文件夾下文件,僅保留mysql等sql
3.修改my.ini,port,...dir等配置server
4.管理員運行cmd,cd>bin:mysqld install [servername]cmd
(5.修改regedit[servername]的ImagePath[mysqld][ini])(可省略)string
6.啓動it
C:\Users\Administrator>cd Desktop
C:\Users\Administrator\Desktop>cd [server filepath]
C:\Users\Administrator\Desktop\[server filepath]>cd bin
C:\Users\Administrator\Desktop\[server filepath]\bin>mysqld install [server name] (--defaults-file="..\my.ini")
Service successfully installed.
(regedit.exeHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\[server name]ImagePath "C:\Users\Administrator\Desktop\[server filepath]\bin\mysqld" --defaults-file="C:\Users\Administrator\Desktop\[server filepath]\my.ini" [server name]) >net start [server name] 刪除服務:sc delete [server name] 建立服務:sc create [server name] binPath="C:\Users\Administrator\Desktop\[server filepath]\bin\mysqld.exe" Type=share Start=auto 查詢端口占用:netstat -ano|findstr "[string]"