This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Simple frmsearch command to find tables without a primary key | |
Run this via: | |
# curl get.dbsake.net > dbsake | |
# export DATADIR=$(mysql -sse 'select @@datadir') PYTHONPATH=$PWD/dbsake | |
# python find_nopk.py | |
!! mysql.slow_log does not appear to have a primary key !! | |
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Examples fetching data from MySQL via /usr/bin/mysql""" | |
import subprocess | |
def get_innodb_log_file_size(): | |
"""Run SELECT @@innodb_log_file_size and return the value as an integer""" | |
process = subprocess.Popen(['mysql', '-ss'], | |
stdout=subprocess.PIPE, | |
stderr=subprocess.STDOUT, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/storage/innobase/handler/ha_innodb.cc | |
+++ b/storage/innobase/handler/ha_innodb.cc | |
@@ -17158,6 +17158,10 @@ ib_warn_row_too_big(const dict_table_t* table) | |
THD* thd = current_thd; | |
+ if(thd == NULL) { | |
+ return; | |
+ } | |
+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/storage/innobase/handler/ha_innodb.cc | |
+++ b/storage/innobase/handler/ha_innodb.cc | |
@@ -17158,6 +17158,11 @@ ib_warn_row_too_big(const dict_table_t* table) | |
THD* thd = current_thd; | |
+ /* If current_thd is NULL, don't send a warning to the client */ | |
+ if(thd == NULL) { | |
+ return; | |
+ } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import fnmatch | |
def inclusion_exclusion_filter(include=(), exclude=()): | |
"""Create an inclusion exclusion filter | |
:param include: sequence of glob patterns to include | |
:param exclude: sequence of glob patterns to exclude | |
:returns: function(name) that filters strings based on the provided filters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Simple frmsearch command to find tables with pre 5.6 date/time types. | |
Run this via: | |
# curl get.dbsake.net > dbsake | |
# DATADIR=$(mysql -sse 'select @@datadir') PYTHONPATH=$PWD/dbsake python frmsearch.py | |
ALTER TABLE `mysql`.`procs_priv` FORCE; | |
ALTER TABLE `mysql`.`columns_priv` FORCE; | |
ALTER TABLE `mysql`.`general_log` FORCE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### kikori - a MySQL binary log archive utility | |
# Support config options | |
format="${KIKORI_FORMAT:-directory}" | |
archive_path="${KIKORI_ARCHIVE_PATH:-/var/log/mysql/archive}" | |
compression_cmd="${KIKORI_COMPRESSION_CMD:-gzip -1}" | |
compression_ext="${KIKORI_COMPRESSION_EXT:-.gz}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[client] | |
port = 3306 | |
socket = /var/run/mysqld/mysqld.sock | |
[mysqld_safe] | |
socket = /var/run/mysqld/mysqld.sock | |
nice = 0 | |
[mysqld] | |
user = mysql | |
pid-file = /var/run/mysqld/mysqld.pid | |
socket = /var/run/mysqld/mysqld.sock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
LUKS_PASSPHRASE="foo" | |
SNAPSHOT_MOUNTPOINT="/mnt/backup" | |
MOUNT_OPTIONS="barrier=0" # nouuid for xfs, etc. | |
# 1) Discover a MySQL datadir | |
datadir=$(mysql -sse 'select @@datadir') |