[z]如何在一台windows主机上安装多个mysql服务
生活随笔
收集整理的這篇文章主要介紹了
[z]如何在一台windows主机上安装多个mysql服务
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
環(huán)境: OS:Windows XP DB:MYSQL5.5 1.正常安裝第一個(gè)mysql(安裝步驟省略) 2.在控制面板里停止第一個(gè)mysql服務(wù) 3.將C:\Program Files\MySQL目錄下的所有目錄和文件copy到另外一個(gè)路徑,我這里是copy到E盤 4.創(chuàng)建第二個(gè)mysql的my.ini文件 第一個(gè)mysql的my.ini文件默認(rèn)是在如下路徑
C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.5\my.ini
copy該ini文件存放到E:\MySQL\mysql_base,這個(gè)路徑可以隨意定義,并修改如下內(nèi)容:
[client]
port=3307?#第一個(gè)數(shù)據(jù)庫的默認(rèn)端口是3306 這里需要另外啟用一個(gè)端口
# The TCP/IP Port the MySQL Server will listen on
port=3307
# Path to installation directory. All paths are usually resolved relative to this.
basedir="E:\MySQL\MySQL Server 5.5\"???????? #第二個(gè)數(shù)據(jù)庫basedir
# Path to the database root
datadir="E:\MySQL\MySQL Server 5.5\data\"??? #第二個(gè)數(shù)據(jù)庫datadir 5.創(chuàng)建啟動(dòng)服務(wù)(此時(shí)在控制面板中可以看到增加了一個(gè)新的服務(wù)) mysqld install MySQL2? --defaults-file="E:\MySQL\mysql_base\ini\my.ini" 6.修改注冊(cè)表 HKEY_LOCAL_MACHINE-->SYSTEM-->CurrentControlSet-->Services
找到剛才創(chuàng)建的MySQL2,將ImagePath修改成如下":
"E:\MySQL\MySQL Server 5.5\bin\mysqld" --defaults-file="E:\MySQL\mysql_base\ini\my.ini" MySQL2
C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.5\my.ini
copy該ini文件存放到E:\MySQL\mysql_base,這個(gè)路徑可以隨意定義,并修改如下內(nèi)容:
[client]
port=3307?#第一個(gè)數(shù)據(jù)庫的默認(rèn)端口是3306 這里需要另外啟用一個(gè)端口
# The TCP/IP Port the MySQL Server will listen on
port=3307
# Path to installation directory. All paths are usually resolved relative to this.
basedir="E:\MySQL\MySQL Server 5.5\"???????? #第二個(gè)數(shù)據(jù)庫basedir
# Path to the database root
datadir="E:\MySQL\MySQL Server 5.5\data\"??? #第二個(gè)數(shù)據(jù)庫datadir 5.創(chuàng)建啟動(dòng)服務(wù)(此時(shí)在控制面板中可以看到增加了一個(gè)新的服務(wù)) mysqld install MySQL2? --defaults-file="E:\MySQL\mysql_base\ini\my.ini" 6.修改注冊(cè)表 HKEY_LOCAL_MACHINE-->SYSTEM-->CurrentControlSet-->Services
找到剛才創(chuàng)建的MySQL2,將ImagePath修改成如下":
"E:\MySQL\MySQL Server 5.5\bin\mysqld" --defaults-file="E:\MySQL\mysql_base\ini\my.ini" MySQL2
參考:http://blog.chinaunix.net/uid-77311-id-3450734.html
轉(zhuǎn)載于:https://www.cnblogs.com/yuechaotian/archive/2013/05/15/3079919.html
總結(jié)
以上是生活随笔為你收集整理的[z]如何在一台windows主机上安装多个mysql服务的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 任信用逾期会怎么样
- 下一篇: linux cmake编译源码,linu