Skip to content

Instantly share code, notes, and snippets.

View altmannmarcelo's full-sized avatar

Marcelo Altmann altmannmarcelo

View GitHub Profile
@altmannmarcelo
altmannmarcelo / prepare.cc
Created August 27, 2023 18:48
prepare.cc
#include <fstream>
int main() {
/*
# Setup
USE test;
CREATE TABLE `big` (
`ID` int DEFAULT NULL,
`b` blob
START_TIMEOUT=120
# Check if sudo is installed or if we are running as root
SUDO=sudo
MYSQL_SERVICE_NAME=""
if [ -f /usr/bin/yum ]; then
MYSQL_SERVICE_NAME=mysqld
if [ ! -f /usr/bin/sudo ]; then
if [[ $(id -u) -eq 0 ]]; then
SUDO=""
else
start_server
backup_dir=$topdir/xb_export_backup
rm -rf $backup_dir
mkdir $backup_dir
mysql -e 'CREATE TABLE test1(a int, b int, PRIMARY KEY (a), KEY (b DESC))' test
mysql -e 'CREATE TABLE test2(a int, b int, PRIMARY KEY (a), KEY (b ASC))' test
mysql -e "INSERT INTO test1 VALUES(1,2)" test
2020-05-20 15:55:34 [INFO] ProxySQL version 2.0.12-38-g58a909a
2020-05-20 15:55:34 [INFO] Detected OS: Linux marcelo-2711-proxysql-1 5.4.0-28-generic #32-Ubuntu SMP Wed Apr 22 17:40:10 UTC 2020 x86_64
2020-05-20 15:55:34 [INFO] ProxySQL SHA1 checksum: 46f8b8fb1e79484931cdaedb6c200dea3e5c0dea
2020-05-20 15:55:34 [INFO] Starting ProxySQL
2020-05-20 15:55:34 [INFO] Sucessfully started
2020-05-20 15:55:34 [INFO] Angel process started ProxySQL process 734330
Standard ProxySQL MySQL Logger rev. 2.0.0714 -- MySQL_Logger.cpp -- Sun May 17 20:24:24 2020
Standard ProxySQL Cluster rev. 0.4.0906 -- ProxySQL_Cluster.cpp -- Sun May 17 20:24:24 2020
Standard ProxySQL Statistics rev. 1.4.1027 -- ProxySQL_Statistics.cpp -- Sun May 17 20:24:24 2020
Standard ProxySQL HTTP Server Handler rev. 1.4.1031 -- ProxySQL_HTTP_Server.cpp -- Sun May 17 20:24:24 2020
INSERT INTO `languages` (`locales`, `name`) VALUES ('en_US', 'English'),
('ab', 'Abkhaz'),
('ab', 'Abkhaz'),
('ab', 'Abkhaz'),
('ab', 'Abkhaz'),
('ab', 'Abkhaz'),
('ab', 'Abkhaz'),
('ab', 'Abkhaz'),
('ab', 'Abkhaz'),
('ab', 'Abkhaz'),
............ DUMPING MAIN DATABASE ............
***** DUMPING global_variables *****
+-----------------------------------------------------+--------------------+
| variable_name | variable_value |
+-----------------------------------------------------+--------------------+
| mysql-shun_on_failures | 5 |
| mysql-shun_recovery_time_sec | 10 |
| mysql-query_retries_on_failure | 1 |
| mysql-client_multi_statements | true |
| mysql-connect_retries_delay | 1 |
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
log-bin
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
log-bin
<?php
date_default_timezone_set('UTC');
$mysqli = new mysqli('127.0.0.1', 'root', 'sekret', 'test', 6033);
if ($mysqli->connect_error) {
die('Connect Error (' . $mysqli->connect_errno . ') '
. $mysqli->connect_error);
}
/* Setup */
echo date('Y-m-d H:i:s') . " Starting to SETUP the test\n";
# RHEL 7.5
vagrant init --box-version "1.6.26" generic/rhel7; vagrant up --provider virtualbox;
# RHEL 7.3
vagrant init --box-version '1.0.4' generic/rhel7; vagrant up --provider virtualbox;
# Centos 7.2
vagrant init --box-version '1603.01' centos/7; vagrant up --provider virtualbox;