MySQL Database Administration Best
Practices
Lalit Choudhary
Agenda
▪ Database design and Planning
▪ MySQL Installation and
Configuration
▪ Optimization
▪ Replication
▪ Backup and Monitoring
▪ Q&A
Database design and planning
● Outlining the functional specifications.
− Considering Application Workflow
− Table Structure and Naming conventions
− Workbench ERD
● Scope and Flexibility of database design.
− Easy to extend
− Capability to Handle large volume of data
−
●
●
MySQL Installation and Configuration
● Ways to install MySQL
− Source code
− Binaries
− Packages
− MySQL Installer MSI and ZIP Archive
− Yum repository
● Configuration
− Storage engine
− Variables
− User management and Access control
●
Optimization
● Hardware
− Storage and file types : SSD/HDD and EXT4 or XFS
on Linux
− Memory : Optimal performance,Large
transaction,indexes,faster response time for ongoing
changes and utilize Disk IO
− CPU : Faster processors with many cores provide
better throughput
Optimization
● Software
− Configuration
● innodb_file_per_table
● innodb_buffer_pool_size
● innodb_buffer_pool_instances
● innodb_log_file_size
● innodb_flush_log_at_trx_commit
● innodb_thread_concurrency
● innodb_flush_method
Optimization
● Query Optimization
− indexes
● Replication
− Read write Load Balancing
Replication
● Replication Components
− MASTER : Binary log dump Thread(s)
− SLAVE : Replication Threads
− Binary Logs : SBR/RBR/Mixed
− Relay Logs
− Information files
Replication
● Important variables and configuration
− Master
● server_id
● log_bin
● binlog_format
● binlog_row_query_log_event
● binlog-do-db
● binlog-ignore-db
Replication
● slave
● server_id
● log_bin
● binlog_format
● log_slave_updates
● relay_log=file_name
● replicate-do-db=db_name
● replicate-ignore-db=db_name
● replicate_wild_do_table
● replicate_wild_ignore_table
Replication
● Best practices
− Enable binary logs on slave
● log_bin
● log-slave-update
● expire_log_days
− Crash-safe slaves
● master-info-repository=TABLE
● Relay-log-info-repository=TABLE
● Relay-log-recovery
− Secure slave
● read-only
● Skip-slave-start
− Avoid replication Lag
● slave_compressed_protocol
● MTR replication
Replication
● With and without GTID
● Need Master_Log_File and Master_Log_Pos
● GTID
− What problems GTID solves?
● It is possible to identify a transaction uniquely across the
replication servers. Make the automation of failover
process much easier. There is no need to do
calculations, inspect the binary log and so on. Just
MASTER_AUTO_POSITION=1.
●
− Enable GTID replication
● gtid_mode: It can be ON or OFF (not 1 or 0). It enables
the GTID on the server.
● log_bin: Enable binary logs. Mandatory to create a
replication environment.
● log-slave-updates: Slave servers must log the changes
that comes from the master in its own binary log.
● Enforce-gtid-consistency : Statements that can’t be
logged in a transactionally safe manner are denied by
the server.
Backup and Monitoring
● Binary Backup
− MySQL Enterprise Backup
● Logical Backup
− mysqldump
● Hot Backup
− Replication slave
● Customized scripts
Backup and Monitoring
● Monitoring and statistics
− SHOW PROCESSLIST
− System databases
− Enterprise Monitoring(MEM)
− MySQL Utilities
− Audit logs & General logs
−
Thank you!

More Related Content

PPTX
MySQL database
PDF
MySQL Storage Engines Landscape
PPT
PPT
MySQL Atchitecture and Concepts
PDF
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
PDF
MySQL Enterprise Backup (MEB)
PPTX
MySQL DBA OCP 1Z0-883
PPTX
MySQL Architecture and Engine
MySQL database
MySQL Storage Engines Landscape
MySQL Atchitecture and Concepts
"Advanced MySQL 5 Tuning" by Michael Monty Widenius @ eLiberatica 2007
MySQL Enterprise Backup (MEB)
MySQL DBA OCP 1Z0-883
MySQL Architecture and Engine

What's hot (16)

PDF
InnoDB Cluster Experience (MySQL User Camp)
PDF
MySQL 8.0 achitecture and enhancement
PDF
Percona Xtrabackup - Highly Efficient Backups
PDF
MySQL Backup and Security Best Practices
PDF
MySQL :What's New #GIDS16
PDF
MySQL Backup & Recovery
PDF
Collaborate 2012 - Administering MySQL for Oracle DBAs
PDF
MySQL For Oracle Developers
PPTX
MyDUMPER : Faster logical backups and restores
PDF
MySQL Advanced Administrator 2021 - 네오클로바
PPTX
High performance and high availability proxies for MySQL
PDF
InnoDB Performance Optimisation
PDF
MySQL Server Backup, Restoration, and Disaster Recovery Planning
PDF
MySQL Performance - Best practices
PDF
MySQL Performance Tuning Variables
PDF
MariaDB 10.5 binary install (바이너리 설치)
InnoDB Cluster Experience (MySQL User Camp)
MySQL 8.0 achitecture and enhancement
Percona Xtrabackup - Highly Efficient Backups
MySQL Backup and Security Best Practices
MySQL :What's New #GIDS16
MySQL Backup & Recovery
Collaborate 2012 - Administering MySQL for Oracle DBAs
MySQL For Oracle Developers
MyDUMPER : Faster logical backups and restores
MySQL Advanced Administrator 2021 - 네오클로바
High performance and high availability proxies for MySQL
InnoDB Performance Optimisation
MySQL Server Backup, Restoration, and Disaster Recovery Planning
MySQL Performance - Best practices
MySQL Performance Tuning Variables
MariaDB 10.5 binary install (바이너리 설치)
Ad

Viewers also liked (17)

ODP
MySQL Monitoring Shoot Out
PDF
MySQL administration in Amazon RDS
PDF
[INSIGHT OUT 2011] B12 better my sql security and administration(ronald)
ODP
MySQL GUI Administration
PDF
Percona Toolkit for Effective MySQL Administration
PPT
Seasonal Event Database Training
PPTX
MySQL Slow Query log Monitoring using Beats & ELK
PDF
MySQL Monitoring 101
PPT
PDF
web programming UNIT VIII python by Bhavsingh Maloth
PDF
Build and deploy scientific Python Applications
PDF
PythonIntro_pycon2010
PDF
Tutorial on-python-programming
PPT
Web 2 0 Ppt
PPT
Php Ppt
PPT
Mysql Ppt
PPT
Linux basic commands
MySQL Monitoring Shoot Out
MySQL administration in Amazon RDS
[INSIGHT OUT 2011] B12 better my sql security and administration(ronald)
MySQL GUI Administration
Percona Toolkit for Effective MySQL Administration
Seasonal Event Database Training
MySQL Slow Query log Monitoring using Beats & ELK
MySQL Monitoring 101
web programming UNIT VIII python by Bhavsingh Maloth
Build and deploy scientific Python Applications
PythonIntro_pycon2010
Tutorial on-python-programming
Web 2 0 Ppt
Php Ppt
Mysql Ppt
Linux basic commands
Ad

Similar to MySQL DBA (20)

PDF
PhpTek Ten Things to do to make your MySQL servers Happier and Healthier
PPTX
MySQL Replication Overview -- PHPTek 2016
PDF
Proper Care and Feeding of a MySQL Database for Busy Linux Administrators
PDF
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux Admins
ODP
The care and feeding of a MySQL database
PDF
MySQL Replication Basics -Ohio Linux Fest 2016
PDF
The Proper Care and Feeding of a MySQL Database for Busy Linux Admins -- SCaL...
PDF
MySQL Replication Update -- Zendcon 2016
PDF
MySQL highav Availability
PDF
Buytaert kris my_sql-pacemaker
PDF
MySQL Replication Troubleshooting for Oracle DBAs
PPTX
ConFoo MySQL Replication Evolution : From Simple to Group Replication
PDF
The Proper Care and Feeding of MySQL Databases
PPTX
MySQL Replication Evolution -- Confoo Montreal 2017
PDF
MySQL 5.6 Replication Webinar
PDF
Best practices for MySQL High Availability
PDF
My S Q L Introduction for 1 day training
PDF
My sql introduction for Bestcom
PDF
Best practices for MySQL/MariaDB Server/Percona Server High Availability
PDF
Congratsyourthedbatoo
PhpTek Ten Things to do to make your MySQL servers Happier and Healthier
MySQL Replication Overview -- PHPTek 2016
Proper Care and Feeding of a MySQL Database for Busy Linux Administrators
Linuxfest Northwest Proper Care and Feeding Of a MySQL for Busy Linux Admins
The care and feeding of a MySQL database
MySQL Replication Basics -Ohio Linux Fest 2016
The Proper Care and Feeding of a MySQL Database for Busy Linux Admins -- SCaL...
MySQL Replication Update -- Zendcon 2016
MySQL highav Availability
Buytaert kris my_sql-pacemaker
MySQL Replication Troubleshooting for Oracle DBAs
ConFoo MySQL Replication Evolution : From Simple to Group Replication
The Proper Care and Feeding of MySQL Databases
MySQL Replication Evolution -- Confoo Montreal 2017
MySQL 5.6 Replication Webinar
Best practices for MySQL High Availability
My S Q L Introduction for 1 day training
My sql introduction for Bestcom
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Congratsyourthedbatoo

Recently uploaded (20)

PDF
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
PDF
Advancing precision in air quality forecasting through machine learning integ...
PDF
EIS-Webinar-Regulated-Industries-2025-08.pdf
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PDF
Human Computer Interaction Miterm Lesson
PPTX
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
PDF
Auditboard EB SOX Playbook 2023 edition.
PDF
The AI Revolution in Customer Service - 2025
PDF
Data Virtualization in Action: Scaling APIs and Apps with FME
PDF
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
PDF
A symptom-driven medical diagnosis support model based on machine learning te...
PDF
Ensemble model-based arrhythmia classification with local interpretable model...
PDF
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
PDF
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
PDF
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
PPTX
Internet of Everything -Basic concepts details
PPTX
Training Program for knowledge in solar cell and solar industry
PDF
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
PDF
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
The-2025-Engineering-Revolution-AI-Quality-and-DevOps-Convergence.pdf
Advancing precision in air quality forecasting through machine learning integ...
EIS-Webinar-Regulated-Industries-2025-08.pdf
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
Human Computer Interaction Miterm Lesson
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
Auditboard EB SOX Playbook 2023 edition.
The AI Revolution in Customer Service - 2025
Data Virtualization in Action: Scaling APIs and Apps with FME
Transform-Your-Factory-with-AI-Driven-Quality-Engineering.pdf
A symptom-driven medical diagnosis support model based on machine learning te...
Ensemble model-based arrhythmia classification with local interpretable model...
Aug23rd - Mulesoft Community Workshop - Hyd, India.pdf
Planning-an-Audit-A-How-To-Guide-Checklist-WP.pdf
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
Internet of Everything -Basic concepts details
Training Program for knowledge in solar cell and solar industry
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
Rapid Prototyping: A lecture on prototyping techniques for interface design

MySQL DBA

  • 1. MySQL Database Administration Best Practices Lalit Choudhary
  • 2. Agenda ▪ Database design and Planning ▪ MySQL Installation and Configuration ▪ Optimization ▪ Replication ▪ Backup and Monitoring ▪ Q&A
  • 3. Database design and planning ● Outlining the functional specifications. − Considering Application Workflow − Table Structure and Naming conventions − Workbench ERD ● Scope and Flexibility of database design. − Easy to extend − Capability to Handle large volume of data − ● ●
  • 4. MySQL Installation and Configuration ● Ways to install MySQL − Source code − Binaries − Packages − MySQL Installer MSI and ZIP Archive − Yum repository ● Configuration − Storage engine − Variables − User management and Access control ●
  • 5. Optimization ● Hardware − Storage and file types : SSD/HDD and EXT4 or XFS on Linux − Memory : Optimal performance,Large transaction,indexes,faster response time for ongoing changes and utilize Disk IO − CPU : Faster processors with many cores provide better throughput
  • 6. Optimization ● Software − Configuration ● innodb_file_per_table ● innodb_buffer_pool_size ● innodb_buffer_pool_instances ● innodb_log_file_size ● innodb_flush_log_at_trx_commit ● innodb_thread_concurrency ● innodb_flush_method
  • 7. Optimization ● Query Optimization − indexes ● Replication − Read write Load Balancing
  • 8. Replication ● Replication Components − MASTER : Binary log dump Thread(s) − SLAVE : Replication Threads − Binary Logs : SBR/RBR/Mixed − Relay Logs − Information files
  • 9. Replication ● Important variables and configuration − Master ● server_id ● log_bin ● binlog_format ● binlog_row_query_log_event ● binlog-do-db ● binlog-ignore-db
  • 10. Replication ● slave ● server_id ● log_bin ● binlog_format ● log_slave_updates ● relay_log=file_name ● replicate-do-db=db_name ● replicate-ignore-db=db_name ● replicate_wild_do_table ● replicate_wild_ignore_table
  • 11. Replication ● Best practices − Enable binary logs on slave ● log_bin ● log-slave-update ● expire_log_days − Crash-safe slaves ● master-info-repository=TABLE ● Relay-log-info-repository=TABLE ● Relay-log-recovery − Secure slave ● read-only ● Skip-slave-start − Avoid replication Lag ● slave_compressed_protocol ● MTR replication
  • 12. Replication ● With and without GTID ● Need Master_Log_File and Master_Log_Pos ● GTID − What problems GTID solves? ● It is possible to identify a transaction uniquely across the replication servers. Make the automation of failover process much easier. There is no need to do calculations, inspect the binary log and so on. Just MASTER_AUTO_POSITION=1. ● − Enable GTID replication ● gtid_mode: It can be ON or OFF (not 1 or 0). It enables the GTID on the server. ● log_bin: Enable binary logs. Mandatory to create a replication environment. ● log-slave-updates: Slave servers must log the changes that comes from the master in its own binary log. ● Enforce-gtid-consistency : Statements that can’t be logged in a transactionally safe manner are denied by the server.
  • 13. Backup and Monitoring ● Binary Backup − MySQL Enterprise Backup ● Logical Backup − mysqldump ● Hot Backup − Replication slave ● Customized scripts
  • 14. Backup and Monitoring ● Monitoring and statistics − SHOW PROCESSLIST − System databases − Enterprise Monitoring(MEM) − MySQL Utilities − Audit logs & General logs −

Editor's Notes