Windows 安裝多個MySQL5.7 Windows安裝MySQL5.7 Windows同時安裝多個MySQL

Windows 安裝多個MySQL5.7 Windows安裝MySQL5.7 Windows同時安裝多個MySQL

 

一、下載和安裝

1、下載和安裝單個MySQL:https://blog.csdn.net/HaHa_Sir/article/details/103547794

2、Linux CentOS 安裝單個MySQL:https://blog.csdn.net/HaHa_Sir/article/details/80552767

 

二、安裝多個

1、解壓安裝包,複製一份,配置文件分別取名爲: my3316.ini 和 my3316.ini

 

 

2、my3316.ini 配置文件如下:

[mysql]

[mysqld]
#設置3316端口
port = 3316
# 設置mysql的安裝目錄
basedir=C:/E/soft/MySQL5.7/mysql3316
# 設置mysql數據庫的數據的存放目錄
datadir=C:/E/soft/MySQL5.7/mysql3316/data
# 允許最大連接數
max_connections=200
# 創建新表時將使用的默認存儲引擎
default-storage-engine=INNODB

# sql_mode
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

# server_id 唯一標識,一臺電腦安裝多個MySQL配置
server_id=mysql3316

3、安裝MySQL 服務: mysqld install MySQL3316 --defaults-file=C:\E\soft\MySQL5.7\mysql3316\my3316.ini

(MySQL3316:爲服務名稱,自定義,不重複即可。)

 

4、初始化MySQL: mysqld --defaults-file=C:\E\soft\MySQL5.7\mysql3316\my3316.ini --initialize

 

5、獲取密碼:data 目錄下, xx.err 配置文件,搜索: " temporary password "

 

6、啓動 MySQL 服務: net start MySQL3316 ; 關閉: net stop MySQL3316 ;

 

7,、登陸: mysql -u root -P 3316 -p , 輸入步驟5,獲取的密碼:xxx

 

8、修改密碼:alter user 'root'@'localhost' identified by "yourpassword";

 

9、刷新: flush privileges;

 

10、quit,退出,重新登陸,驗證密碼是否修改成功!

 

11、開啓遠程登錄: GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;

 

12、安裝 3326端口mysql ,上述步驟,重複一遍即可。

 

13、安裝成功後,可在Windows 服務中查看:

 

三、可能遇到的問題

 

1、own variable 'defaults-file=E:/soxxx:https://blog.csdn.net/cqcaj40400/article/details/100317541

2、 Found option without preceding group in config file: https://www.cnblogs.com/YueJinSanQian/p/9596711.html 

 

(今天是2020年的第一天,閒着沒事,試了試安裝多個MySQL。 若對您有幫助,幫我點個讚唄。有問題,歡迎留言。 祝大家,新年快樂!)

 

 

 Linux CentOS 安裝MySQL

 刪除MySQL服務 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章