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 mysql.connector | |
import time | |
from concurrent.futures import ThreadPoolExecutor | |
def prepare_test_data(cursor, conn): | |
cursor.execute("DROP TABLE IF EXISTS institutions") | |
cursor.execute(""" | |
CREATE TABLE institutions ( | |
id INT PRIMARY KEY, | |
data VARCHAR(255) |
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 mysql.connector | |
import time | |
# Connect to MySQL database | |
conn = mysql.connector.connect( | |
host="127.0.0.1", | |
user="root", | |
port="4000", | |
database="test" | |
) |
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 threading | |
import time | |
import mysql.connector | |
import uuid | |
import random | |
''' | |
create table tb ( |
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 mysql.connector | |
from mysql.connector import pooling | |
from concurrent.futures import ThreadPoolExecutor, as_completed | |
import logging | |
import time | |
import sys | |
import random | |
import string | |
# Database connection details |
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
# /// script | |
# requires-python = ">=3.13" | |
# dependencies = [ | |
# "mysql-connector-python", | |
# ] | |
# /// | |
import threading | |
import time |
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 threading | |
import mysql.connector | |
from mysql.connector import Error | |
import random | |
import string | |
import time | |
from datetime import datetime, timedelta | |
from collections import Counter | |
import logging |
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
# /// script | |
# requires-python = ">=3.13" | |
# dependencies = [ | |
# "mysql-connector-python", | |
# ] | |
# /// | |
import mysql.connector | |
# Database configuration |
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 mysql.connector | |
from datetime import datetime | |
# Get Unix epoch time (1970-01-01 00:00:00) | |
epoch_time = datetime.utcfromtimestamp(0) # Unix time 0 in UTC | |
# MySQL-compatible timestamp string | |
formatted_time = epoch_time.strftime('%Y-%m-%d %H:%M:%S') |
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 mysql.connector | |
import re | |
slow_log_files = ['file1','file2'] | |
table = "slow_log" | |
connection = mysql.connector.connect( | |
host="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
import mysql.connector | |
import subprocess | |
import os | |
db = 'test' | |
table = 'lineitem' | |
version = 'v8.3.0' |
NewerOlder