MySQL – Binaries Logs – Review Settings

Background

A quick documentation on how to start reviewing Binary Log settings for a MySQL Instance.

Review

Review Account mysql is running under

ps aux

Code


$ ps aux | grep -v "grep" | grep "mysql"

Output

Explanation

  1. User
    • mysql
  2. Process ID
    • 4400
  3. Program Name
    • /apps/mysql/sbin/mysqld
  4. Base dir
    • /apps/mysql
  5. Data dir
    • /data/mysql
  6. plugin-dir
    • /usr/lib64/mysql/plugin
  7. user
    • mysql
  8. log-error
    • /apps/mysql/log/mysql-err.log
  9. pid-file
    • /var/run/mysql/mysqld.pid
  10. socket
    • /var/run/mysql/mysql.sock
  11. port
    • 3306

sudo to account mysql is running under

syntax


sudo su – mysql

confirm

Script


whoami

Output


Where is conf file?

/apps/mysql/bin

syntax


ls -la /apps/mysql/bin/*conf*

output

/etc

syntax


ls -la /etc/my*

output

Explanation

Matches found

  1. /etc/my.cnf

 

Configuration file

/etc/my.cnf

Syntax


cat /etc/my.cnf

Image

Explanation

  1. log_bin
    • log_bin=/logs/mysql/mysql-bin.log
  2.  max_binlog_size
    • max_binlog_size=100MB
  3.  expire_logs_days
    • expire_logs_days=1
  4. binlog_format
    • binlog_format=row

/logs/mysql/mysql-bin.log

Objective

Review /logs/mysql folder for mysql-bin.###### files.

Syntax


ls -la --block-size=M /logs/mysql/mysql-bin*

Image

/logs/mysql/mysql-bin.index

Objective

Review /logs/mysql/mysql-bin.index file for a listing of binary log files.

Syntax


cat /logs/mysql/mysql-bin.index

Image

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s