1、下載mysql https://dev.mysql.com/downloads/installer/ 選擇windows操作系統和位數
安裝並添加環境變量.
2、向window注冊mysql服務,必須使用管理員權限打開cmd,輸入命令
mysqld.exe --install MySql --defaults-file="D:\phpstudy\PHPTutorial\MySQL\my.ini"
成功的返回結果為 Service successfully installed.
注意打開cmd時使用管理員權限打開 否則報錯 Install/Remove of the Service Denied!
3、啟動服務
net start mysql