Skip to content

Instantly share code, notes, and snippets.

@yoku0825
yoku0825 / csv2slowlog.pl
Created October 18, 2012 09:02
slow_log.CSV -> slow.log convert
This script is moved to Github.
https://github.com/yoku0825/my_slowlog/blob/master/csv2slowlog.pl
@yoku0825
yoku0825 / mysql_status_collector.pl
Created October 18, 2012 09:04
MySQL "SHOW GLOBAL STATUS" collect for rrdtool
This script is moved to Github.
https://github.com/yoku0825/my_i_s/blob/master/status_collector.pl
@yoku0825
yoku0825 / table2slowlog.pl
Created October 22, 2012 08:06
convert mysql.slow_log -> slow.log
this script is moved to Github.
https://github.com/yoku0825/my_slowlog/blob/master/table2slowlog.pl
@yoku0825
yoku0825 / innotop1.9.0_MySQL5.6.patch
Created December 26, 2012 10:33
anonymous Gistになってしまったので貼りなおし。。
*** innotop 2012-09-08 03:51:43.000000000 +0900
--- /usr/local/bin/innotop 2012-12-26 19:28:11.218670660 +0900
***************
*** 369,375 ****
my $w = qr/(\w+)/; # Words
my $fl = qr/([\w\.\/]+) line $d/; # Filename and line number
my $h = qr/((?:0x)?[0-9a-f]*)/; # Hex
! my $s = qr/(\d{6} .?\d:\d\d:\d\d)/; # InnoDB timestamp
# If you update this variable, also update the SYNOPSIS in the pod.
@yoku0825
yoku0825 / gist:4386692
Created December 27, 2012 08:56
えげつないmysqld_multi用my.cnfになったw
[mysqld_multi]
user = mysqld_multi
password = mysqld_multi
log = /var/log/mysqld_multi.log
[mysqld]
user = mysql
log-error = error.log
log-warnings = 1
[mysqld_multi]
user = mysqld_multi
password = ***
log = /home/yoku0825/mysqld_multi.log
[mysqld]
loose-wsrep_provider = /home/yoku0825/xc/lib/libgalera_smm.so
#loose-wsrep_cluster_address = gcomm://192.168.xxx.xxx
loose-wsrep_cluster_address = gcomm://
loose-wsrep_slave_threads = 2
# mysql56
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.10-log Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
"317080310120587266",
"",
"",
"",
"",
"2013-03-28 01:06:51 +0000",
"web",
"チケットの切り方が判らなくて書いてあったTwitterアカウントにメンション送ったら、「ありがとう、チケット切ってもらえる?」って言われて結局再挑戦してる。"
#!/bin/sh
CMDNAME=$0
if [ $# -le 0 ] ;then
echo "Usage: $CMDNAME database database ..."
fi
shift `expr $OPTIND - 1`
for database in $@ ;do
mysql55> CREATE FUNCTION rrand (start INT, end INT) RETURNS INT NO SQL RETURN RAND() * (end - start) + start;
Query OK, 0 rows affected (0.00 sec)
mysql55> SELECT rrand(1, 3);
+-------------+
| rrand(1, 3) |
+-------------+
| 2 |
+-------------+
1 row in set (0.00 sec)