Fish in the river

思考 技术
记录 回忆
  1. Main page
  2. 运维技术
  3. Dock
  4. Main content

mysql 修改端口配置

2024年12月26日 44hotness 0likes 0comments

因为我在一个Host主机上部署了两个mysql container.不要问我为什么要部署两个。为什么不放在一个HOST中,建立两个数据库。

是因为两个应用的所需版本不一样。

那这个时候,后安装的那个就需要改一下端口。

改端口的方法如下:

  1. 创建一个文件my-custom.cnf文件,文件内容如下:

[mysqld]
port=3307

在这个文件中,将mysql的端口从3306改为3307.

2. 在docker-compose中将这个文件挂载到container中。并且其他container连接到mysql时,需要变更端口号,如下图。

3.确认一下,是否成功

 

 

Tag: Linux
Last updated:2024年12月26日

joey

This person is a lazy dog and has left nothing

Like
< Last article
Next article >

Comments

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
Cancel

归档

  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024

分类目录

  • C#
  • Dock
  • Excel
  • Kindle
  • Linux
  • Windows
  • 生活感悟
  • 群晖
  • 运维技术

COPYRIGHT © 2024 水中小鱼. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang