当前位置:网站首页>Implementation steps of mysql start log in docker

Implementation steps of mysql start log in docker

2022-07-06 23:20:00 1024 questions

Catalog

1. Check out Ann mysql Container status

2. Enter the inside of the container

3. Sign in mysql database

4. see binlog Whether the log is on , Close after viewing mysql

5. Edit the configuration file to open binlog, Set up log file

6. Exit the container

7. restart mysql Containers , And check whether the startup is successful

8. see binlog Whether the log status is enabled

9. Check the log

1. Check out Ann mysql Container status docker ps

2. Enter the inside of the container docker exec -it 4ae9238c176a /bin/bash

3. Sign in mysql database mysql -uroot -p123456

4. see binlog Whether the log is on , Close after viewing mysql

see :show variables like 'log_bin';

close :exit

remarks :ON Open log ,OFF Close the log  

5. Edit the configuration file to open binlog, Set up log file

5.1 First in /etc Under the folder  mysqld.cnf File path

find /etc -name mysqld.cnf

 5.2 edit mysqld.cnf file

vim /etc/mysql/mysql.conf.d/mysqld.cnf

remarks : without vim compiler Install first vim compiler

apt-get updateapt-get install vim

remarks : Guarantee general_log_file Path exists ,( This is my path ) If there is no Then the path configuration refers to log_error Configuration path

remarks : Pay attention to saving after adding , preservation , preservation

6. Exit the container exit

7. restart mysql Containers , And check whether the startup is successful docker  restart 4ae9238c176adocker ps

8. see binlog Whether the log status is enabled docker exec -it 4ae9238c176a /bin/bashmysql -uroot -p123456show variables like 'log_bin';exit

9. Check the log

This is about docker in mysql This is the end of the article on the implementation steps of opening logs , More about docker mysql Open the log content, please search the previous articles of SDN or continue to browse the relevant articles below. I hope you will support SDN more in the future !


原网站

版权声明
本文为[1024 questions]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207061505471021.html