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
import threading | |
import time | |
import mysql.connector | |
import uuid | |
import random | |
''' | |
create table tb ( |
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
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 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 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 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 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 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 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' |
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
import mysql.connector | |
try: | |
connection = mysql.connector.connect( | |
host="127.0.0.1", | |
port="4000", | |
user="root", | |
password="", | |
database="test" | |
) |
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
import threading | |
import time | |
import mysql.connector | |
from mysql.connector import pooling | |
from collections import Counter | |
import sys |
NewerOlder