View dbdeployer demo
This file contains 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 <gmax@cpan.org> | |
RUN groupadd -r msandbox \ | |
&& useradd -m -s /bin/bash -g msandbox msandbox | |
View tutorial Percona Live EU 2019
This file contains 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) |
View clone.sh
This file contains 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 |
View sample.txt
This file contains 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 |
View purge process list from slow queries or idle connections
This file contains 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() |
View partition_helper
This file contains 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 |
View schema_comparison
This file contains 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; |