• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to change the audit log path in the MySQL Docker

by admin

1. Here we use 5.7.29 Docker image as an example.

$ docker load -i mysql-enterprise-server-5.7.29.tar

2. You can bind OS mounts to Docker directory, assume you want to keep the audit logs under /bak/logs directory on the host.

$ docker run --name=mysql1 \
--mount type=bind,src=/bak/my.cnf,dst=/etc/my.cnf \
--mount type=bind,src=/bak/data,dst=/var/lib/mysql \
--mount type=bind,src=/bak/logs,dst=/var/lib/logs \
-d mysql/enterprise-server:5.7

3. Start the mysql:

$ docker start mysql1

4. Start the Docker shell and install the audit log plugin:

$ docker exec -it mysql1 bash

shell> mysql -uroot -ppassword
mysql> source /usr/share/mysql/audit_log_filter_linux_install.sql

5. If you want to change the location of audit log, modify the my.cnf file:

[mysqld]

....

loose_audit_log_file=/var/lib/logs/audit.log

Filed Under: DevOps, Docker, mysql

Some more articles you might also be interested in …

  1. “Error: Could Not Find A Ready Tiller Pod” – helm error
  2. Understanding the Different Configuration files used for MySQL Server
  3. How to Find and Delete Empty Directories and Files in Linux
  4. My Development Environment Set up on Windows to use Python for Web Dev & Data Science
  5. How to schedule master node running pod/service as a worker node
  6. How to Stop and Start Ec2 instance using Jenkins
  7. Understanding MySQL Storage Engines – MyISAM, MEMORY, BLACKHOLE and ARCHIVE
  8. MySQL – How to Set Maximum Rates for Connections and Queries
  9. How to convert text files to all upper or lower case
  10. How To Configure Separate Override.conf For Multiple MySQL Instances Using Systemd

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright