• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

HM-SpringCloud微服务系列11.1.2【案例导入】


Recommended Posts

2.1 导入商品管理案例

2.1.1 CentOS虚拟机Docker安装MySQL

你需要在后期的数据同步中使用MySQL的主从功能,所以你需要使用Docker在虚拟机中运行一个MySQL容器(新的防止干扰其他环境)。

为了方便MySQL的后期配置,我们先准备两个目录目录,用于挂载容器的数据和配置文件:#进入/tmp目录。

cd /tmp

#创建一个文件夹

mkdir mysql

#输入mysql目录

cd mysql

进入mysql目录后,执行以下Docker命令: Docker Run \

-p 3306:3306 \

-命名mysql \

-v $ PWD/conf :/etc/MySQL/conf . d \

-v $PWD/logs:/logs \

-v $ PWD/data :/var/lib/MySQL \

-e MYSQL_ROOT_PASSWORD=123 \

-特权\

-d \

mysql:5

在/tmp/mysql/conf目录下添加一个my.cnf文件作为MySQL: # create file的配置文件

touch /tmp/mysql/conf/my.cnf

内容:[mysqld]

跳过名称解析

character_set_server=utf8

datadir=/var/lib/mysql

服务器id=1000

修改后,你必须重启容器:docker重启mysql。

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now