以安裝5.6.51為例
第一步下載軟件
地址: https://downloads.mysql.com/archives/community/
第二步 解壓軟件包 打開cmd 工作目錄切換到bin 具體方式 盤符切換 d: 文件夾切換 cd D:\到bing下
輸入指令 mysqld --install MySQL5.6.51 其中MySQL5.6.5是你起的服務名字
輸入指令 net start MySQL5.6.51 啟動服務
結束
默認賬號root無密碼。可到navicat連接后可視化更改用戶密碼
附快速創建用戶的指令
在bin目錄下新建一個txt 名稱叫create_db.txt // 具體叫啥都行
啟動服務后的指令后面接着輸入指令 mysql -uroot <create_db.txt,即可快速創建一個用戶
txt文件中寫入以下東西 其中 name是 創建的用戶名稱 123456是密碼 test是創建的庫名
CREATE DATABASE `test` CHARACTER SET 'utf8mb4' COLLATE 'utf8mb4_general_ci';
grant all privileges on *.* to 'name'@'127.0.0.1' identified by '123456';
grant all privileges on *.* to 'name'@'localhost' identified by '123456';
FLUSH PRIVILEGES;