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 strict; | |
use warnings; | |
use DBI; | |
my @dsn; | |
$dsn[0] = shift or help('no dns1'); | |
$dsn[1] = shift or help('no dns1'); | |
my @dbh; |
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 | |
# The MySQL Partitions helper | |
# Copyright (C) 2008-2015 Giuseppe Maxia | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; version 2 of the License | |
# | |
# 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
-- SQL | |
drop procedure if exists purge_slow_queries; | |
drop procedure if exists purge_idle_connections; | |
drop event if exists auto_purge_slow_queries; | |
drop event if exists auto_purge_idle_connections; | |
delimiter // | |
create procedure purge_idle_connections() |
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
# Configuration node 1 | |
[mysqld] | |
user = gmax | |
port = 25617 | |
socket = /tmp/mysql_sandbox25617.sock | |
basedir = /home/gmax/opt/mysql/8.0.16 | |
datadir = /home/gmax/sandboxes/multi_msb_8_0_16/node1/data | |
tmpdir = /home/gmax/sandboxes/multi_msb_8_0_16/node1/tmp | |
pid-file = /home/gmax/sandboxes/multi_msb_8_0_16/node1/data/mysql_sandbox25617.pid | |
bind-address = 127.0.0.1 |
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 | |
dbdeployer deploy single 5.7.26 --master --sandbox-directory=master_5_7_26 --port=18000 --db-password=different --db-user=different | |
dbdeployer deploy single 8.0.17 --master --sandbox-directory=master_8_0_17 --port=18001 --db-password=different --db-user=different | |
dbdeployer deploy single 8.0.17 --master --sandbox-directory=slave_8_0_17 --port=18002 | |
~/sandboxes/master_5_7_26/use -t < fill.sql | |
du -sh ~/sandboxes/*/data |
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
Use a Linux or Mac computer | |
Download at least the following 2 files: | |
1) https://github.com/datacharmer/dbdeployer/releases/tag/v1.39.0 . (~ 5MB) | |
2a) https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.17-linux-x86_64-minimal.tar.xz (Linux 42 MB) | |
or | |
2b) https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.17-macos10.14-x86_64.tar.gz (Mac 148 MB) |
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
### Dockerfile | |
FROM ubuntu:18.04 | |
LABEL MAINTAINER Giuseppe Maxia <[email protected]> | |
RUN groupadd -r msandbox \ | |
&& useradd -m -s /bin/bash -g msandbox msandbox | |