- Sep 18 Fri 2020 09:51
-
MySQL Array Simulation in Stored Procedure
- Jul 07 Tue 2020 15:44
-
Extracts, orders, and then prints grants for MySQL user accounts (pt-show-grants)
Extracts, orders, and then prints grants for MySQL user accounts (pt-show-grants)
# Extracts, orders, and then prints grants for MySQL user accounts
pt-show-grants --host 10.0.1.120 -u admin --ask-pass --port 3306 > testdb-grants.sql
- Jun 29 Mon 2020 13:21
-
MySQL Stored Procedure - Nested Loop Example
MySQL Stored Procedure - Nested Loop Example
DELIMITER $$
CREATE PROCEDURE sp_fix_dup_nickname()
BEGIN
DECLARE outer_done, inner_done BOOLEAN DEFAULT FALSE;
- Jun 17 Wed 2020 09:39
-
Metabase H2 DB Migration to MySQL 5.7
Metabase H2 DB Migration to MySQL 5.7
#### On Aurora New MySQL ####################
create database metabase charset utf8mb4;
create user `metabase_app`@`192.168.%` identified by 'xxxxxx';
grant all on metabase.* to `metabase_app`@`192.168.%`;
- Mar 04 Wed 2020 14:00
-
Steps for Upgrading Percona-Toolkit to the Latest Version
MySQL 5.7 : Steps for Upgrading Percona-Toolkit to the Latest Version
pt-online-schema-change --version
>>
pt-online-schema-change 2.2.20
- Feb 27 Thu 2020 16:42
-
MySQL Slave - Skip Replication for A Particular Table
MySQL Slave - Skip Replication for A Particular Table
mysql> stop slave sql_thread;
mysql> change replication filter Replicate_Wild_Ignore_Table=('mydb.my_unused_table1');
mysql> start slave sql_thread;
- Feb 26 Wed 2020 10:59
-
MySQL - Export & Import Table Data Based on the SQL Query
Export Table Data:
mysql -utest_usr -p"xxx"-h127.0.0.1 -P3306 -e "select * from test_usr.test_table where flag = 1" > test_usr.test_table.txt 2>/dev/null
Import Table Data: (ignore first row column name)
mysql> LOAD DATA LOCAL INFILE '/home/mysql/test_usr.test_table.txt' INTO TABLE my_new_test_table IGNORE 1 LINES;
- Feb 03 Mon 2020 15:08
-
MySQL Table Fragmentation Detection and De-fragmentation Implementation
check_table_fragmentation.sql
>>
MySQL > source check_table_fragmentation.sql
SELECT table_schema, table_name, CONCAT(ROUND((data_free / 1024 / 1024),2),'MB') as data_free
FROM information_schema.tables
- Dec 17 Tue 2019 18:13
-
Multiple Log File Viewer (Linux Bash)
cat log_file_viewer.sh
>>
#################################
# Multiple Log File Viewer (Linux Bash)
# Programmed By DanBrother
- Oct 28 Mon 2019 14:03
-
Solving MySQL slave lag Issues
There're MySQL global variable settings that will help for improving the speed of SQL apply in slave db.
That would solve the issue of slave lagging.
slave_rows_search_algorithms comes to the rescue.
slave_rows_search_algorithms
default: TABLE_SCAN,INDEX_SCAN
- Sep 12 Thu 2019 16:50
-
MySQL Online Table Redefinition Without Locking The Table Using Percona Toolkit : pt-online-schema-change
- Aug 07 Wed 2019 17:27
-
MySQL Trigger Example
MySQL Trigger Example
https://1drv.ms/w/s!AiM4lZDi7mITgZpt7BobprUleWqgHg?e=AuvIpd