栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

docker安装mariadb,并开启binlog

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

docker安装mariadb,并开启binlog

拉取mariadb镜像

docker pull mariadb

配置文件名称叫 mariadb.cnf

# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# If you are new to MariaDB, check out https://mariadb.com/kb/en/basic-mariadb-articles/

#
# This group is read both by the client and the server
# use it for options that affect everything
#
[client-server]
# Port or socket location where to connect
# port = 3306
socket = /run/mysqld/mysqld.sock

# import all .cnf files from configuration directory
[mariadbd]
skip-host-cache
skip-name-resolve

[mysqld]
datadir=/var/lib/mysql
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
log_bin=/var/lib/mysql/mysql-bin
log_bin_index=/var/lib/mysql/mysql-bin.index
server-id=1
binlog_format=row

!includedir /etc/mysql/mariadb.conf.d/
!includedir /etc/mysql/conf.d/

启动镜像,这里的 /root/mysql/mariadb.cnf:/etc/mysql/mariadb.cnf
前面 /root/mysql/mariadb.cnf 是你的本地路径,后面 /etc/mysql/mariadb.cnf 是固定的,不要修改

docker run -itd --name mariadb-test -v /root/mysql/mariadb.cnf:/etc/mysql/mariadb.cnf  -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mariadb
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/395627.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号