在一台主機上安裝多個mysql服務,一台主機多個mysql

來源:互聯網
上載者:User

在一台主機上安裝多個mysql服務,一台主機多個mysql

1.mysql安裝(省略)

2.停止mysql服務

3.複製mysql的所有檔案到另一個目錄()




4.開啟複製目錄下的my.ini檔案修改

   [client]
port=3307 #第一個資料庫的預設連接埠是3306 這裡需要另外啟用一個連接埠
# 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="D:\secondmysql\MySQL Server 5.5\"         #第二個資料庫basedir
# Path to the database root
datadir="D:\secondmysql\MySQL Server 5.5\data\"    #第二個資料庫datadir



5.管理員身份運行cmd建立啟動服務

mysqld install MySQL2  --defaults-file="D:\secondmysql\MySQL Server 5.5\my.ini"

   

6.查看服務並開啟


7.串連


在串連過程中可能會出現


預設密碼為空白。

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.