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
SELECT TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, COLUMN_TYPE, | |
(CASE DATA_TYPE | |
WHEN 'tinyint' THEN 255 | |
WHEN 'smallint' THEN 65535 | |
WHEN 'mediumint' THEN 16777215 | |
WHEN 'int' THEN 4294967295 | |
WHEN 'bigint' THEN 18446744073709551615 | |
END >> IF(LOCATE('unsigned', COLUMN_TYPE) > 0, 0, 1) | |
) AS MAX_VALUE, | |
AUTO_INCREMENT AS CURRENT_VALUE, |
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
/* | |
* Gracewatch 1.0 | |
* Matthew Boehm <matthew@matthewboehm.com> | |
* | |
* Gracewatch is a multi-threaded MySQL monitoring solution developed for | |
* a client that had no in-house monitoring team. | |
* | |
* Using libConfig (http://www.hyperrealm.com/libconfig/), gracewatch reads | |
* a list of servers and credentials and spawns a pthread for each server. | |
* The thread connects to the host and every minute preforms a mysql_ping() |
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
SELECT CONCAT((@@key_buffer_size + @@query_cache_size + (@@innodb_buffer_pool_size * 1.05 + 20*1024*1024) + @@innodb_additional_mem_pool_size + @@innodb_log_buffer_size | |
+ @@max_connections * (@@read_buffer_size + @@read_rnd_buffer_size + @@sort_buffer_size + @@join_buffer_size + @@binlog_cache_size + @@tmp_table_size | |
+ @@thread_stack)) / 1024/1024/1024, ' GB') AS "POTENTIAL MEMORY USAGE"; |
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
/* | |
Copyright (c) 2014, Percona LLC and/or its affiliates. All rights reserved. | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU Affero General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
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
import sys | |
import mysql.connector | |
from mysql.connector.errors import InterfaceError | |
from time import sleep | |
mydb = mysql.connector.connect(host="", user="", password="", database="mysql") | |
cursor = mydb.cursor(dictionary=True) | |
while True: |
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/perl | |
use DBI; | |
use Email::MIME; | |
use Log::Log4perl qw(get_logger :levels); | |
use Data::Dumper; | |
use strict; | |
# For backgrounding |