MySQL Replication Update -- Zendcon 2016Dave Stokes
How does MySQL work at a conceptual level and at a how-to-do-it level is covered in this presentation plus information on other replication options like Group Replication and Multi Master
MySQL Replication Basics -Ohio Linux Fest 2016Dave Stokes
This is a bare bones, getting started with MySQL replication presentation showing both GTID and non-GTID replication of MySQL relational databases plus some supporting MySQL utilities
MySQL is a SQL database that also does NoSQL. You can access data in the InnoDB or NDB storage engines as a key/value pair at amazing speeds while retaining simultaneous SQL access of the same data. Plus MySQL 5.7 features a new native JSON data type
MariaDB 10.5 binary install (바이너리 설치)
- 네오클로바 DB지원사업부
1. About MariaDB
1.1 MariaDB 개요
1.2 MariaDB as a R-DBMS
1.3 Open Source Database System
2. 설치
2.1 설치 기본 정보
2.2 설치 준비
2.3 MariaDB 설치
2.4 MariaDB 시작 / 접속 / 종료
2.5 추가 설정
MySQL has a set of utilities written in Python that can do some amazing things for your MySQL instances from setting up replication with automatic fail over to copying database
MySQL Replication Update -- Zendcon 2016Dave Stokes
How does MySQL work at a conceptual level and at a how-to-do-it level is covered in this presentation plus information on other replication options like Group Replication and Multi Master
MySQL Replication Basics -Ohio Linux Fest 2016Dave Stokes
This is a bare bones, getting started with MySQL replication presentation showing both GTID and non-GTID replication of MySQL relational databases plus some supporting MySQL utilities
MySQL is a SQL database that also does NoSQL. You can access data in the InnoDB or NDB storage engines as a key/value pair at amazing speeds while retaining simultaneous SQL access of the same data. Plus MySQL 5.7 features a new native JSON data type
MariaDB 10.5 binary install (바이너리 설치)
- 네오클로바 DB지원사업부
1. About MariaDB
1.1 MariaDB 개요
1.2 MariaDB as a R-DBMS
1.3 Open Source Database System
2. 설치
2.1 설치 기본 정보
2.2 설치 준비
2.3 MariaDB 설치
2.4 MariaDB 시작 / 접속 / 종료
2.5 추가 설정
MySQL has a set of utilities written in Python that can do some amazing things for your MySQL instances from setting up replication with automatic fail over to copying database
MySQL Administrator
Basic course
- MySQL 개요
- MySQL 설치 / 설정
- MySQL 아키텍처 - MySQL 스토리지 엔진
- MySQL 관리
- MySQL 백업 / 복구
- MySQL 모니터링
Advanced course
- MySQL Optimization
- MariaDB / Percona
- MySQL HA (High Availability)
- MySQL troubleshooting
네오클로바
http://neoclova.co.kr/
MySQL Cluster Performance Tuning - 2013 MySQL User ConferenceSeveralnines
Slides from a presentation given at Percona Live MySQL Conference 2013 in Santa Clara, US.
Topics include:
- How to look for performance bottlenecks
- Foreign Key performance in MySQL Cluster 7.3
- Sharding and table partitioning
- efficient use of datatypes (e.g. BLOBS vs varbinary)
We always say Galera replication is synchronous, but is it really? Always? For every step? What are the caveats of such replication? What does virtual-synchronous mean?
In this talk, I'll discuss what certification and group communication are, and how they're performed. I'll also cover the difference between MySQL 5.6 GTID and Galera GTID. The goal of this presentation is to explain how a transaction is replicated using Galera.
After this presentation, the audience should be comfortable with terms like "brute force abort," "flow control," "local certification failure," etc.
The plan is to demystify Galera technology with easy illustrations and analogies.
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationKenny Gryp
What are the implementation differences between Percona XtraDB Cluster 5.7, Galera Cluster 5.7 and MySQL Group Replication?
- How do each of these work?
- How do they behave differently?
- Are there any major issues with any of these?
This talk will describe these differences and also shed some light on how QA is done for each of these different technologies.
2007 MySQL Conference and Expo 90 minute presentation specifically targeting Oracle Developers and DBAs. Topics included.
*DBA Tips, Tricks, Gotcha's & Tools
* Key Differences for Developers
* Migrating from Oracle to MySQL
MySQL High Availability Solutions - Avoid loss of service by reducing the r...Olivier DASINI
MySQL High Availability Solutions
Avoid loss of service by reducing the risk of failures
MySQL InnoDB Cluster
Collection of products that work together to provide a complete High Availability solution for MySQL
MySQL InnoDB ReplicaSet
Administer a set of MySQL instances running asynchronous replication
MySQL NDB Cluster
A high-availability, high-redundancy version of MySQL adapted for the distributed computing environment
MySQL Administrator
Basic course
- MySQL 개요
- MySQL 설치 / 설정
- MySQL 아키텍처 - MySQL 스토리지 엔진
- MySQL 관리
- MySQL 백업 / 복구
- MySQL 모니터링
Advanced course
- MySQL Optimization
- MariaDB / Percona
- MySQL HA (High Availability)
- MySQL troubleshooting
네오클로바
http://neoclova.co.kr/
MySQL Cluster Performance Tuning - 2013 MySQL User ConferenceSeveralnines
Slides from a presentation given at Percona Live MySQL Conference 2013 in Santa Clara, US.
Topics include:
- How to look for performance bottlenecks
- Foreign Key performance in MySQL Cluster 7.3
- Sharding and table partitioning
- efficient use of datatypes (e.g. BLOBS vs varbinary)
We always say Galera replication is synchronous, but is it really? Always? For every step? What are the caveats of such replication? What does virtual-synchronous mean?
In this talk, I'll discuss what certification and group communication are, and how they're performed. I'll also cover the difference between MySQL 5.6 GTID and Galera GTID. The goal of this presentation is to explain how a transaction is replicated using Galera.
After this presentation, the audience should be comfortable with terms like "brute force abort," "flow control," "local certification failure," etc.
The plan is to demystify Galera technology with easy illustrations and analogies.
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationKenny Gryp
What are the implementation differences between Percona XtraDB Cluster 5.7, Galera Cluster 5.7 and MySQL Group Replication?
- How do each of these work?
- How do they behave differently?
- Are there any major issues with any of these?
This talk will describe these differences and also shed some light on how QA is done for each of these different technologies.
2007 MySQL Conference and Expo 90 minute presentation specifically targeting Oracle Developers and DBAs. Topics included.
*DBA Tips, Tricks, Gotcha's & Tools
* Key Differences for Developers
* Migrating from Oracle to MySQL
MySQL High Availability Solutions - Avoid loss of service by reducing the r...Olivier DASINI
MySQL High Availability Solutions
Avoid loss of service by reducing the risk of failures
MySQL InnoDB Cluster
Collection of products that work together to provide a complete High Availability solution for MySQL
MySQL InnoDB ReplicaSet
Administer a set of MySQL instances running asynchronous replication
MySQL NDB Cluster
A high-availability, high-redundancy version of MySQL adapted for the distributed computing environment
Embarcadero® ER/Studio®, an industry-leading data modeling tool, helps companies discover, document, and re-use data assets. With round-trip database support, data architects have the power to easily reverse-engineer, analyze, and optimize existing databases. Productivity gains and enforcement of organizational standards can be achieved with ER/Studio’s strong collaboration capabilities.
Five Database Mistakes and how to fix them -- Confoo VancouverDave Stokes
Very few developers are learning Structured Query Language (about 2%) but then wonder why their database queries stink. This presentation covers five common database problems and how to fix them
Polyglot Database - Linuxcon North America 2016Dave Stokes
Many Relation Databases are adding NoSQL features to their products. So what happens when you can get direct access to the data as a key/value pair, or you can store an entire document in a column of a relational table, and more
How to Analyze and Tune MySQL Queries for Better Performanceoysteing
Tutorial at Oracle Open World 2015:
Performance of SQL queries plays a big role in application performance. If some queries execute slowly, these queries or the database schema may need tuning. This tutorial covers query processing, optimization methods, and how the MySQL optimizer chooses a specific plan to execute SQL. See demonstrations on how to use tools such as EXPLAIN (including the JSON-based variant), optimizer trace, and performance schema to analyze query plans. See how the Visual Explain functionality in MySQL Workbench helps you to visualize these plans. Based on the analysis, the tutorial covers how to take the next steps for performance tuning. It might mean forcing a particular index, changing the schema, or modifying configuration parameters.
What Your Database Query is Really DoingDave Stokes
Do you ever wonder what your database servers is REALLY doing with that query you just wrote. This is a high level overview of the process of running a query
Tips on how to prepare MySQL 5.7 GIS databases for the upgrade to MySQL 8.0 and the introduction of geography support.
Presentation given at the Pre-FOSDEM MySQL Day in Brussels, February 3, 2017.
The technology has almost written off MySQL as a database for new fancy NoSQL databases like MongoDB and Cassandra or even Hadoop for aggregation. But MySQL has a lot to offer in terms of 'ACID'ity, performance and simplicity. For many use-cases MySQL works well. In this week's ShareThis workshop we discuss different tips & techniques to improve performance and extend the lifetime of your MySQL deployment.
MySQL Replication Evolution -- Confoo Montreal 2017Dave Stokes
MySQL Replication has evolved since the early days with simple async master/slave replication with better security, high availability, and now InnoDB Cluster
ConFoo MySQL Replication Evolution : From Simple to Group ReplicationDave Stokes
MySQL Replication has been around for many years but how wee do you under stand it? Do you know about read/write splitting, RBR vs SBR style replication, and InnoDB cluster?
MySQL Replication Overview -- PHPTek 2016Dave Stokes
MySQL Replication has been around for a long time but are you up to date on the latest updates such as multi-source or group replication? Can you explain the differences between GTID and non-GTID replication? This is a quick 30 minute overview of MySQL replication as of 5.7
MySQL Cluster 7.3 Performance Tuning - Severalnines SlidesSeveralnines
The MySQL Cluster 7.x series introduced a number of features to allow for fine-grained control over the real-time behaviour of the NDB storage engine. New threads have been introduced, and users are able to control placement of these threads, as well as locking the memory such that no swapping occurs. In an ideal run-time environment, CPUs handling data node threads will not execute other threads apart from OS kernel threads or interrupt handling. Correct tuning of certain parameters can be specially important for certain types of workloads.
This presentation covers the different tuning aspects of MySQL Cluster.
- Application design guidelines
- Schema Optimization
- Index Selection and Tuning
- Query Tuning
- OS Tuning
- Data Node internals
- Optimizations for real-time behaviour
This presentation looks closely at how to get the most out of your MySQL Cluster 7.x runtime environment.
OSMC 2008 | Monitoring MySQL by Geert VanderkelenNETWAYS
Monitoring MySQL has a long history within Nagios. Several plugins are available already. In addition to that, there are probably lots of plugins that have been developed by the community. We take a look at some of these and discuss what kind of additional useful information could be pulled out of a MySQL Server for monitoring it even better. A simple example on how to write such plugins will be shown, also using NDB API for monitoring MySQL Cluster. Now that MySQL Enterprise Monitor (MEM) is available, we'll go through the possibilities for combining the two platforms. We will also discuss the NDOUtils for storing configuration and event data using MySQL.
This talk starts with a brief overview of MySQL itself: some history, where it's heading too, and why it is so successful.
MySQL is an ubiquitous open source database but do you know how make it secure? This talk is from the 2022 Texas Cyber Summit on how to do just that. Make sure you data and database are secure.
MySQL Indexes and Histograms - RMOUG Training Days 2022Dave Stokes
Nobody complains when the database is too fast. But they do gripe when it slows down. The two most popular ways to increase query speed are indexes and histograms. But there a dozens of options for indexes and a lot of lots of bad information on how to use them. Histograms are great but not for all types of data. This session covers the hows and whys of both approaches
Develop PHP Applications with MySQL X DevAPIDave Stokes
The X DevAPI provides a way to use MySQL as a NoSQL JSON Document Store and this presentation covers how to use it with the X DevAPI PHP PECL extension. And it also works with traditional relational tables. Presented at Oracle CodeOne 24 October 2018
The Proper Care and Feeding of MySQL DatabasesDave Stokes
Many Linux System Administrators are 'also' accidental database administrators. This is a guide for them to keep their MySQL database instances happy, health, and glowing
MySQL can now be used as a NoSQL JSON Document store so you get the best of NoSQL and SQL world. This talk covers the features of the X Devapi, the MySQL Document Store, and how to use relational tables with the new SQL features
MySQL Without The SQL -- Oh My! PHP[Tek] June 2018Dave Stokes
The MySQL Document Store allows developers to use MySQL as a JSON Document Store -- no normalizing of data, setting up relational tables, and you do not have to use SQL to query data. And you get the both the SQL and NoSQL worlds on one server
Presentation Skills for Open Source FolksDave Stokes
Do you want to present at a Linuxfest or other open source conference but do not know where or how to start. Follow these recommendations and you will be on your way to being a speaking all star. Discover how write your presentation. what tools you need, and other items of note
MySQL Without the SQL -- Oh My! Longhorn PHP ConferenceDave Stokes
You can now use MySQL without needing to know Structured Query Language (SQL) with the MySQL Document Store. Access JSON documents and/or relational tables using the new X DevAPI
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)Dave Stokes
MySQL 8 has many new features and this presentation covers the new data dictionary, improved JSON functions, roles, histograms, and much more. Updated after SunshinePHP 2018 after feedback
This presentation is an INTRODUCTION to intermediate MySQL query optimization for the Audience of PHP World 2017. It covers some of the more intricate features in a cursory overview.
SwanseaCon 2017 presentation on Making MySQL Agile-ish. Relational Databases are not usually considered part of the Agile Programming movement but there are many new features in MySQL to make it easier to include it. This presentation covers how MySQL is moving to help support agile development while maintaining the traditional 'non agile' stability expected from a database.
The very basics of programming in PHP to store/retrieve data on a relational database management system (RDMS). For those looking for intermediate to advanced material, please see 'What Your Database Query is Really Doing'.
This 7-second Brain Wave Ritual Attracts Money To You.!nirahealhty
Discover the power of a simple 7-second brain wave ritual that can attract wealth and abundance into your life. By tapping into specific brain frequencies, this technique helps you manifest financial success effortlessly. Ready to transform your financial future? Try this powerful ritual and start attracting money today!
# Internet Security: Safeguarding Your Digital World
In the contemporary digital age, the internet is a cornerstone of our daily lives. It connects us to vast amounts of information, provides platforms for communication, enables commerce, and offers endless entertainment. However, with these conveniences come significant security challenges. Internet security is essential to protect our digital identities, sensitive data, and overall online experience. This comprehensive guide explores the multifaceted world of internet security, providing insights into its importance, common threats, and effective strategies to safeguard your digital world.
## Understanding Internet Security
Internet security encompasses the measures and protocols used to protect information, devices, and networks from unauthorized access, attacks, and damage. It involves a wide range of practices designed to safeguard data confidentiality, integrity, and availability. Effective internet security is crucial for individuals, businesses, and governments alike, as cyber threats continue to evolve in complexity and scale.
### Key Components of Internet Security
1. **Confidentiality**: Ensuring that information is accessible only to those authorized to access it.
2. **Integrity**: Protecting information from being altered or tampered with by unauthorized parties.
3. **Availability**: Ensuring that authorized users have reliable access to information and resources when needed.
## Common Internet Security Threats
Cyber threats are numerous and constantly evolving. Understanding these threats is the first step in protecting against them. Some of the most common internet security threats include:
### Malware
Malware, or malicious software, is designed to harm, exploit, or otherwise compromise a device, network, or service. Common types of malware include:
- **Viruses**: Programs that attach themselves to legitimate software and replicate, spreading to other programs and files.
- **Worms**: Standalone malware that replicates itself to spread to other computers.
- **Trojan Horses**: Malicious software disguised as legitimate software.
- **Ransomware**: Malware that encrypts a user's files and demands a ransom for the decryption key.
- **Spyware**: Software that secretly monitors and collects user information.
### Phishing
Phishing is a social engineering attack that aims to steal sensitive information such as usernames, passwords, and credit card details. Attackers often masquerade as trusted entities in email or other communication channels, tricking victims into providing their information.
### Man-in-the-Middle (MitM) Attacks
MitM attacks occur when an attacker intercepts and potentially alters communication between two parties without their knowledge. This can lead to the unauthorized acquisition of sensitive information.
### Denial-of-Service (DoS) and Distributed Denial-of-Service (DDoS) Attacks
1.Wireless Communication System_Wireless communication is a broad term that i...JeyaPerumal1
Wireless communication involves the transmission of information over a distance without the help of wires, cables or any other forms of electrical conductors.
Wireless communication is a broad term that incorporates all procedures and forms of connecting and communicating between two or more devices using a wireless signal through wireless communication technologies and devices.
Features of Wireless Communication
The evolution of wireless technology has brought many advancements with its effective features.
The transmitted distance can be anywhere between a few meters (for example, a television's remote control) and thousands of kilometers (for example, radio communication).
Wireless communication can be used for cellular telephony, wireless access to the internet, wireless home networking, and so on.
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBrad Spiegel Macon GA
Brad Spiegel Macon GA’s journey exemplifies the profound impact that one individual can have on their community. Through his unwavering dedication to digital inclusion, he’s not only bridging the gap in Macon but also setting an example for others to follow.
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesSanjeev Rampal
Talk presented at Kubernetes Community Day, New York, May 2024.
Technical summary of Multi-Cluster Kubernetes Networking architectures with focus on 4 key topics.
1) Key patterns for Multi-cluster architectures
2) Architectural comparison of several OSS/ CNCF projects to address these patterns
3) Evolution trends for the APIs of these projects
4) Some design recommendations & guidelines for adopting/ deploying these solutions.
2. Dave Stokes - MySQL Community Manager
David.Stokes@Oracle.Com
@Stoker
slideshare.net/davidmstokes
Elephantanddolphin.blogger.com or opensourcedba.wordpress.com
2
3. 21 Years Old
MySQL has been part of
Oracle’s family of databases
for six years.
MySQL 8
MySQl 5.7 is the current release
but the next version will be
MySQL 8. Big feature is real
time data dictionary
Group Replication
Active master-master
replication.
JSON
A new native JSON datatype to
store documents in a column of
a table
Document Store
Programmers not know SQL
but need a database? X Devapi
allows them to use RDMS from
language of choice
Encryption
Use Oracle Key Vault to
encrypt your data at rest.
3
4. It is a package of utilities that are used for maintenance and
administration of MySQL servers. These utilities encapsulate
a set of primitive commands, and bundles them so they can
be used to perform macro operations with a single
command.
The utilities are written in Python, available under the GPLv2
license, and are extendable using the supplied library. They
are designed to work with Python versions 2.6 or later and
there is no support (yet) for Python v3.1.
The MySQL Utilities?
FREE! FREE! 4
5. The MySQL
Utilities are
scripts
Designed to be easily
extensible, use common
interfaces, and designed to
make complex operations
simple
In other words they automate some
fairly gruesome tasks to save you
time and sanity
5
8. Compare and Contrast -- Copy a database
8
1. On server 1
a. mysqldump -u root World City > foo.sql
b. Scp foo.sql server2
2. On server 2
a. Mysql -u root World < foo.sql
1. On server1 OR server2 or ??
a. Mysqldbcopy --source=root@server1
-destination=root@server2
world:world
9. Six Area of Use
Binary Log Operations
Database Operations
General Operations
High Availability Operations
Server Operations
Specialized Operations
9
10. 10
mysqlauditadmin — Allows users to perform maintenance actions on the audit log
mysqlauditgrep — Allows users to search the current or an archived audit log
mysqlbinlogmove — Binary log relocate utility
mysqlbinlogpurge — Binary log purge utility
mysqlbinlogrotate — Binary log rotate utility
mysqldbcompare — Compare Two Databases and Identify Differences
mysqldbcopy — Copy Database Objects Between Servers
mysqldbexport — Export Object Definitions or Data from a Database
mysqldbimport — Import Object Definitions or Data into a Database
mysqldiff — Identify Differences Among Database Objects
mysqldiskusage — Show Database Disk Usage
mysqlfailover — Automatic replication health monitoring and failover
mysqlfrm — File reader for .frm files.
mysqlgrants — Display grants by object
mysqlindexcheck — Identify Potentially Redundant Table Indexes
mysqlmetagrep — Search Database Object Definitions
mysqlprocgrep — Search Server Process Lists
mysqlreplicate — Set Up and Start Replication Between Two Servers
mysqlrplms — Set Up and Start Replication from a Slave to Multiple Masters
mysqlrpladmin — Administration utility for MySQL replication
mysqlrplcheck — Check Replication Prerequisites
mysqlrplshow — Show Slaves for Master Server
mysqlrplsync — Replication synchronization checker
mysqlserverclone — Clone Existing Server to Create New Server
mysqlserverinfo — Display Common Diagnostic Information from a Server
mysqlslavetrx — Slave transaction skip utility
mysqluc — Command line client for running MySQL Utilities
mysqluserclone — Clone Existing User to Create New User
11. Examples
There are 28
MySQL Utilities
and rather than go into
detail on all of them, let us
peek at some common
tasks using the MySQL
Utilities to show you how
you can use them
11
12. Example 1
Setup automatic failover on four
MySQL instances running on
one server
Master server is
on port 3331 and
there other
servers are setup
on 3332, 3333,
and 3334
12
13. shell> mysqlfailover --master=root@localhost:3331 --discover-
slaves-login=root --log=log.txt
MySQL Replication Monitor and Failover Utility
Failover Mode = auto Next Interval = Mon Mar 19 15:56:03 2012
Master Information
------------------
Binary Log File Position Binlog_Do_DB Binlog_Ignore_DB
mysql-bin.000001 571
GTID Executed Set
2A67DE00-2DA1-11E2-A711-00764F2BE90F:1-7 [...]
Replication Health Status
+------------+-------+---------+--------+------------+---------+
| host | port | role | state | gtid_mode | health |
+------------+-------+---------+--------+------------+---------+
| localhost | 3331 | MASTER | UP | ON | OK |
| localhost | 3332 | SLAVE | UP | ON | OK |
| localhost | 3333 | SLAVE | UP | ON | OK |
| localhost | 3334 | SLAVE | UP | ON | OK |
+------------+-------+---------+--------+------------+---------+
Q-quit R-refresh H-health G-GTID Lists U-UUIDs L-log entries
13
14. Q-quit R-refresh H-health G-GTID Lists U-UUIDs L-log entries
If we press G -- GTID Report
Master Information
------------------
Binary Log File Position Binlog_Do_DB Binlog_Ignore_DB
mysql-bin.000001 571
GTID Executed Set
2A67DE00-2DA1-11E2-A711-00764F2BE90F:1-7 [...]
Master GTID Executed Set
+-------------------------------------------+
| gtid |
+-------------------------------------------+
| 2A67DE00-2DA1-11E2-A711-00764F2BE90F:1-7 |
| 5503D37E-2DB2-11E2-A781-8077D4C14B33:1-3 |
+-------------------------------------------+
14
15. Failover?
Failover starting...
# Candidate slave localhost:3332 will become the new master.
# Preparing candidate for failover.
# Creating replication user if it does not exist.
# Stopping slaves.
# Performing STOP on all slaves.
# Switching slaves to new master.
# Starting slaves.
# Performing START on all slaves.
# Checking slaves for errors.
# Failover complete.
# Discovering slaves for master at localhost:3332
Failover console will restart in 5 seconds.
15
16. Failed over!!
MySQL Replication Monitor and Failover Utility
Failover Mode = auto Next Interval = Mon Mar 19 16:05:12 2012
Master Information
------------------
Binary Log File Position Binlog_Do_DB Binlog_Ignore_DB
mysql-bin.000001 1117
GTID Executed Set
2A67DE00-2DA1-11E2-A711-00764F2BE90F:1-7 [...]
UUIDs
+------------+-------+---------+--------+------------+---------+
| host | port | role | state | gtid_mode | health |
+------------+-------+---------+--------+------------+---------+
| localhost | 3332 | MASTER | UP | ON | OK |
| localhost | 3333 | SLAVE | UP | ON | OK |
| localhost | 3334 | SLAVE | UP | ON | OK |
+------------+-------+---------+--------+------------+---------+
16
17. Compare Two
Databases and
Identify
Differences
This utility compares the objects
and data from two databases to find
differences. It identifies objects
having different definitions in the
two databases and presents them
in a diff-style format of choice.
Differences in the data are shown
using a similar diff-style format.
Changed or missing rows are
shown in a standard format of
GRID, CSV, TAB, or VERTICAL.
‘But it works in test!!’
17
18. mysqldbcompare --server1=root@localhost emp1:emp2 --run-
all-tests
# server1 on localhost: ... connected.
# Checking databases emp1 on server1 and emp2 on server2
#
# WARNING: Objects in server2:emp2 but not in server1:emp1:
# TRIGGER: trg
# PROCEDURE: p1
# TABLE: t1
# VIEW: v1
#
18
19. mysqldbcompare --server1=root@localhost emp1:emp2 --run-
all-tests continued
# Data differences found among rows:
--- emp1.departments
+++ emp2.departments
@@ -1,4 +1,4 @@
************************* 1. row *************************
dept_no: d002
- dept_name: dunno
+ dept_name: Finance
1 rows.
19
20. mysqldbcompare --server1=root@localhost emp1:emp2 --run-
all-tests continued even more!
# Rows in emp1.departments not in emp2.departments
************************* 1. row *************************
dept_no: d008
dept_name: Research
1 rows.
# Rows in emp2.departments not in emp1.departments
************************* 1. row *************************
dept_no: d100
dept_name: stupid
1 rows.
20
24. mysqlindexcheck — Identify Potentially Redundant Table Indexes
shell> mysqlindexcheck --server=root@localhost employees
# Source on localhost: ... connected.
# The following indexes are duplicates or redundant
for table employees.dept_emp:
#
CREATE INDEX emp_no ON employees.dept_emp (emp_no) USING BTREE
# may be redundant or duplicate of:
ALTER TABLE employees.dept_emp ADD PRIMARY KEY (emp_no, dept_no)
# The following indexes are duplicates or redundant
for table employees.dept_manager:
#
CREATE INDEX emp_no ON employees.dept_manager (emp_no) USING BTREE
# may be redundant or duplicate of:
ALTER TABLE employees.dept_manager ADD PRIMARY KEY (emp_no, dept_no)
# The following indexes are duplicates or redundant
for table employees.salaries:
# 24
25. 25
shell> mysqluserclone --source=root@localhost
--destination=root@localhost
joe@localhost sam:secret1@localhost
sally:secret2@localhost
# Source on localhost: ... connected.
# Destination on localhost: ... connected.
# Cloning 2 users...
# Cloning joe@localhost to user sam:secret1@localhost
# Cloning joe@localhost to user sally:secret2@localhost
# ...done.
Note: SYS Schema (MySQL 5.6/7) allows you to
find redundant indexes, queries running
without indexes, and help your spot queries
that may need indexes.
26. 26
Check Grants -- who has permission to do what
shell> mysqlgrants --server=user:pass@localhost:3310
--show=user_grants util_test util_test.t3 util_test.t2
util_test.t1 util_test.p1 util_test.f1
# DATABASE `util_test`:
# - 'joe'@'user' : ALL PRIVILEGES
# - 'joe_wildcard'@'%' : ALL PRIVILEGES
# - 'priv_test_user'@'%' : EXECUTE, GRANT OPTION, SELECT, TRIGGER, UPDATE
# - 'priv_test_user2'@'%' : EXECUTE, SELECT, UPDATE
# - 'priv_test_user3'@'%' : ALTER ROUTINE, DELETE, DROP, EXECUTE, TRIGGER,
UPDATE
# TABLE `util_test`.`t1`:
# - 'joe'@'user' : ALL PRIVILEGES
# - 'joe_wildcard'@'%' : ALL PRIVILEGES
# - 'priv_test_user'@'%' : GRANT OPTION, SELECT, TRIGGER, UPDATE
# - 'priv_test_user2'@'%' : ALL PRIVILEGES, GRANT OPTION
# - 'priv_test_user3'@'%' : DELETE, DROP, TRIGGER, UPDATE
27. shell> mysqlgrants --server=user:pass@localhost:3310
--show=raw util_test util_test.t3 util_test.t2
util_test.t1 util_test.p1 util_test.f1
# DATABASE `util_test`:
# - For 'joe'@'user'
GRANT ALL PRIVILEGES ON `util_test`.* TO 'joe'@'user'
# - For 'joe_wildcard'@'%'
GRANT ALL PRIVILEGES ON `util_test`.* TO 'joe_wildcard'@'%'
# - For 'priv_test_user'@'%'
GRANT EXECUTE, TRIGGER ON `util_test`.* TO 'priv_test_user'@'%' WITH GRANT
OPTION
GRANT SELECT, UPDATE ON *.* TO 'priv_test_user'@'%'
# - For 'priv_test_user2'@'%'
GRANT SELECT, UPDATE, SHUTDOWN, EXECUTE ON *.* TO 'priv_test_user2'@'%'
# - For 'priv_test_user3'@'%'
GRANT DROP, EXECUTE, TRIGGER ON *.* TO 'priv_test_user3'@'%'
GRANT UPDATE, DELETE, ALTER ROUTINE ON `util_test`.* TO 'priv_test_user3'@'%'
27
28. Find all objects with a name that matches the pattern 't_' (the
letter t followed by any single character)
28
shell> mysqlmetagrep --pattern="t_" --server=john@localhost
+------------------------+--------------+--------------+-----------+
| Connection | Object Type | Object Name | Database |
+------------------------+--------------+--------------+-----------+
| john:*@localhost:3306 | TABLE | t1 | test |
| john:*@localhost:3306 | TABLE | t2 | test |
| john:*@localhost:3306 | TABLE | tm | test |
+------------------------+--------------+--------------+-----------+
29. shell> mysqlmetagrep -b --pattern="%t2%" --
server=john@localhost:3306
+------------------------+--------------+--------------+-----------+
| Connection | Object Type | Object Name | Database |
+------------------------+--------------+--------------+-----------+
| john:*@localhost:3306 | TRIGGER | tr_foo | test |
| john:*@localhost:3306 | TABLE | t2 | test |
+------------------------+--------------+--------------+-----------+
29
QUESTION: Why is tr_foo listed here when the Object Name does
not match “%t2%”?????
Answer: the TRIGGER tr_foo’s body references the object ‘t2’
30. Process control
shell> mysqlprocgrep --server=root@localhost
--match-command=sleep --age=1h --kill-connection
You can remove MySQL queries that have been
sleeping for one hour
30
31. mysqluc
31
...is part of MySQL Workbench (found
under tools) and it gives you access to
the MySQL Utilities
And you can skip the first 5 letters of
each command
Mysqldbcopy = dbcopy
32. Find process
mysqluc> procgrep --sql --match-user=root --match-state=starting --print
SELECT
Id, User, Host, Db, Command, Time, State, Info
FROM
INFORMATION_SCHEMA.PROCESSLIST
WHERE
USER LIKE 'root'
AND
STATE LIKE 'starting'
32
33. shell> mysqlprocgrep --kill-connection --sql-body
--match-user=www-data --match-state=sleep
DECLARE kill_done INT;
DECLARE kill_cursor CURSOR FOR
SELECT
Id, User, Host, Db, Command, Time, State, Info
FROM
INFORMATION_SCHEMA.PROCESSLIST
WHERE
user LIKE 'www-data'
AND
State LIKE 'sleep'
OPEN kill_cursor;
BEGIN
DECLARE id BIGINT;
DECLARE EXIT HANDLER FOR NOT FOUND SET kill_done = 1;
kill_loop: LOOP
FETCH kill_cursor INTO id;
KILL CONNECTION id;
END LOOP kill_loop;
END;
CLOSE kill_cursor;
33
34. Replication made easy - Are the settings good
shell> mysqlrplcheck --master=root@host1:3310 --
slave=root@host2:3311
# master on host1: ... connected.
# slave on host2: ... connected.
Test Description Status
------------------------------------------------------------------------
Checking for binary logging on master [pass]
Are there binlog exceptions? [pass]
Replication user exists? [pass]
Checking server_id values [pass]
Is slave connected to master? [pass]
Check master information file [pass]
Checking InnoDB compatibility [pass]
Checking storage engines compatibility [pass]
Checking lower_case_table_names settings [pass]
Checking slave delay (seconds behind master) [pass]
34
36. Cloneshell> mkdir /source/test123
shell> mysqlserverclone --server=root:pass@localhost
--new-data=/Users/cbell/source/test123 --new-port=3310
--root-password=pass --mysqld=--log-bin=mysql-bin
# Cloning the MySQL server running on localhost.
# Creating new data directory...
# Configuring new instance...
# Locating mysql tools...
# Setting up empty database and mysql tables...
# Starting new instance of the server...
# Testing connection to new instance...
# Success!
# Setting the root password...
# ...done.
36
37. 37
shell> mysqlrplms --slave=root:root@localhost:3306
--masters=root:root@localhost:3307,root:root@localhost:3308
# Starting multi-source replication...
# Press CTRL+C to quit.
# Switching to master 'localhost:3307'.
# master on localhost: ... connected.
# slave on localhost: ... connected.
#
# Current Master Information:
+-------------------+-----------+---------------+-------------------+
| Binary Log File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+-------------------+-----------+---------------+-------------------+
| clone-bin.000001 | 594 | N/A | N/A |
+-------------------+-----------+---------------+-------------------+
# GTID Executed Set: 00a4e027-a83a-11e3-8bd6-28d244017f26:1-2
#
# Health Status:
+------------+-------+---------+--------+------------+---------+
| host | port | role | state | gtid_mode | health |
+------------+-------+---------+--------+------------+---------+
| localhost | 3307 | MASTER | UP | ON | OK |
| localhost | 3306 | SLAVE | UP | ON | OK |
| localhost | 3308 | MASTER | UP | ON | OK |
+------------+-------+---------+--------+------------+---------+
38. 38
shell> mysqlrpladmin --master=root@localhost:3331
--slaves=root@localhost:3332,root@localhost:3333,root@localhost:3334
--candidates=root@localhost:3333,root@localhost:3334 elect
# Electing candidate slave from candidate list then slaves list.
# Best slave found is located on localhost:3332.
# ...done.
List Candidate Slaves
39. Skips a GTID Transaction
shell> mysqlslavetrx --gtid-set=af6b22ee-7b0b-11e4-aa8d-
606720440b68:7-9
--
slaves=user:pass@localhost:3311,user:pass@localhost:3312
WARNING: Using a password on the command line interface can
be insecure.
#
# GTID set to be skipped for each server:
# - localhost@3311: af6b22ee-7b0b-11e4-aa8d-606720440b68:7-9
# - localhost@3312: af6b22ee-7b0b-11e4-aa8d-606720440b68:7-9
#
# Injecting empty transactions for 'localhost:3311'...
# Injecting empty transactions for 'localhost:3312'...
#
#...done.
39
40. Extending
Easy to extend with a very nice example in the docs. All utils use a three tier
organization and support on the Utilities section of Forums.MySQL.Com
http://forums.mysql.com/list.php?144
How to at:
https://dev.mysql.com/doc/mysql-utilities/1.6/en/mysql-utils-intro-developers.html
40
41. Other Recommended Tools
MySQL Workbench
https://dev.mysql.com/downloads/workbench/
Percona Toolkit
https://www.percona.com/software/database-tools/percona-toolkit
41
42. Dave Stokes - MySQL Community Manager
David.Stokes@Oracle.Com
@Stoker
slideshare.net/davidmstokes
Elephantanddolphin.blogger.com or opensourcedba.wordpress.com
42