🤠⚡ Deconstructing MySQL Error 150: How a Corrupted Dump Turned into a Cyberpunk SQL Injector
Every single developer who spends time in the trenches knows this exact moment. It’s 4:00 PM, your coffee is stone cold, you’ve got a massive production SQL dump to import so you can replicate a nasty client bug locally, you spin up your database stack feeling invincible, pipe the file into the CLI, and… BAM! Right in the teeth:
ERROR 1005 (HY000) at line 133: Can't create table `enterprise_core_db`.`auth_groups_permissions`
(errno: 150 "Foreign key constraint is incorrectly formed")
Everything grinds to a dead stop. Your database looks like a truck that threw a rod in the middle of nowhere: twenty tables made it through, half a dozen are trapped in limbo, rows are half-populated, and if you dare hit the Up arrow to run the command again, you slam straight into: Table 'auth_groups' already exists. Pure, unadulterated chaos.
Instead of opening a 500,000-line text file to fight line-by-line like a caveman, I built an endgame solution: a standalone, zero-dependency desktop app with a Cyberpunk / Netrunner HUD, designed to stream multi-gigabyte files effortlessly, bypass engine constraints on the fly, and compile natively to both Linux (.AppImage) and Windows (.exe).
Here is the full technical post-mortem of the infamous Error 150, the low-level streaming tricks to bypass it, and the complete architecture behind the tool. Let’s roll! 🚀
🧐 Why Does This Thing Blow Up? (Error 150 Demystified)
To fix a nasty bug for good, you have to understand what InnoDB is actually thinking under the hood.
When you feed InnoDB a CREATE TABLE containing a FOREIGN KEY constraint, it doesn't just nod and move along. The engine throws on its inspector goggles and audits its internal data dictionary with obsessive paranoia. If a single byte or flag doesn't match up, it bails out with a generic Error 1005 and logs the specific culprit as errno: 150.
InnoDB Strict Metadata Audit
+-------------------------------------------------------+
| 1. Does the parent table actually exist in the schema?|
| 2. Are data types binary-identical across both keys? |
| 3. Are UNSIGNED / SIGNED flags 100% matched? |
| 4. Do Charset and Collation match down to the wire? |
| 5. Are both tables InnoDB, or is an old MyISAM hiding?|
+-------------------------------------------------------+
|
[Did any check fail?]
/ \
(Yes) (No)
/ \
🛑 ERROR 150 (Kaboom!) ✅ Table Created
The four most common reasons your import will hit the wall:
1. The Alphabetical Order Trap 🔤
Tools like mysqldump can be brutally literal: they often dump CREATE TABLE statements in strict alphabetical order. If your schema has auth_groups_permissions referencing auth_permissions, the child table (auth_groups_permissions) will try to instantiate before its parent exists. InnoDB looks at the catalog, finds no parent, and slams the door.
2. The INT vs INT UNSIGNED Blunder 🔢
A classic late-night migration blunder. In the parent table, an architect wrote:
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT
And in the child table, someone rushing a ticket wrote:
`group_id` INT NOT NULL
To a human eye, "they're both just ints." To the database engine, they are entirely different animals. One spans from 0 to 4,294,967,295; the other spans -2,147,483,648 to 2,147,483,647. They occupy distinct binary footprints. InnoDB inspects them and instantly declines the foreign key.
3. Collation and Charset Clashes 🥊
This frequently plagues legacy codebases. You might have ancient tables created back in MySQL 5.5 using latin1_swedish_ci, while newer feature branches use utf8mb4_unicode_ci. If a string-based foreign key (VARCHAR) attempts to bridge two columns with different collations, the engine cannot guarantee index sort equivalence in its B+ trees. Result? Immediate rejection.
4. Mixed Storage Engines 🚜
If a child table declares ENGINE=InnoDB while the referenced entity was left behind as ENGINE=MyISAM, no force on earth can link them. MyISAM does not support ACID transactions or relational integrity checks.
🤦♂️ Why Standard Fixes Are an Exercise in Pain
When your backup file grows beyond a few megabytes, the standard playbook falls apart:
phpMyAdmin: Uploading a large
.sqlfile triggers the dreaded413 Request Entity Too Largeerror or dies 60 seconds later from a PHPmax_execution_timetimeout. You end up with half-baked tables and zero answers.MySQL Workbench / DBeaver: Opening a heavy
.sqlfile forces the GUI to parse hundreds of thousands of lines into syntax trees. Your laptop fans spin up like a jet engine, the GUI locks up, and the process gets killed by an Out-of-Memory (OOM) exception.Text Editors (VS Code, Notepad++): Attempting to open a 500 MB SQL file just to manually find line 133 and comment out constraints is a guaranteed way to freeze your desktop.
💡 The Master Stroke: Pipeline Streaming (stdin Injection)
How do real system engineers tackle this? By hijacking the byte stream on the fly.
You don't need to touch or modify the original .sql dump. Instead, inject session-level override pragmas directly into the standard input (stdin) of the native MySQL client. This temporarily blinds the engine's constraint watchdogs during import and turns them back on when it finishes:
SET NAMES utf8mb4;➡️ Neutralizes encoding and character-set discrepancies.SET FOREIGN_KEY_CHECKS = 0;➡️ The silver bullet. Tells InnoDB: "Build the tables in whatever order they show up; don't care if the parent hasn't been born yet."SET UNIQUE_CHECKS = 0;➡️ Suspends immediate unique index evaluation, dramatically accelerating bulk inserts.SET FOREIGN_KEY_CHECKS = 1;➡️ Restores database integrity enforcement once the data stream completes.
On a Unix shell, you can pull this off with a subshell pipeline:
(echo "SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS=0; SET UNIQUE_CHECKS=0;"; \
cat heavy_backup.sql; \
echo "SET FOREIGN_KEY_CHECKS=1; SET UNIQUE_CHECKS=1;") | \
/opt/lampp/bin/mysql --max_allowed_packet=128M -u root enterprise_core_db
It works like a charm. But having to memorize binary paths, handle Unix sockets vs. TCP ports, and wrestle with Windows command prompts with spaces in their paths is tedious.
So, let's wrap this logic inside a rock-solid, zero-dependency desktop app with full Cyberpunk flair. 🦾
🧬 Introducing CYBER_SQL // BREACHER
To make this tool practical for daily use, it was built around four strict principles:
Zero External Dependencies: No massive
pip installsetups. Written entirely with Python's standard library (tkinter,subprocess,threading,shutil). Download and run.Chunked 1 MB Streaming: The app reads and pipes the file in continuous 1 MB byte arrays. You could feed it a 30 GB dump and your RAM usage won't budge.
Automatic Binary Discovery: Detects MySQL installations across Linux (system packages and
/opt/lampp/bin/mysql), Windows (system PATH, XAMPP, Laragon, MySQL Server), and macOS (Homebrew, XAMPP).Cyberpunk HUD: High-contrast void blacks (
#08090d), electric cyan (#00f0ff), warning neon pink (#ff0055), and matrix green (#00ff75). Debugging database schemas might as well feel like hacking Arasaka mainframes.
🐍 The Complete Source Code (cyber_import.py)
Here is the complete, drop-in application code:
#!/usr/bin/env python3
"""
CYBER_SQL // BREACHER v2.0.77
Multiplatform MySQL Database Deployment Tool with Cyberpunk HUD.
Zero external dependencies (Pure Python Standard Library).
"""
import os
import sys
import glob
import shutil
import threading
import subprocess
import tkinter as tk
from tkinter import filedialog, messagebox
# ---------------- CYBERPUNK PALETTE ----------------
C_BG_VOID = "#08090d"
C_PANEL = "#10121b"
C_PANEL_ALT = "#161926"
C_CYAN = "#00f0ff"
C_PINK = "#ff0055"
C_YELLOW = "#ffe600"
C_GREEN = "#00ff75"
C_TEXT = "#d8dbf0"
C_MUTED = "#5d627d"
C_ALERT = "#ff2a2a"
FONT_MONO = ("Consolas", 10)
FONT_MONO_BOLD = ("Consolas", 10, "bold")
FONT_TITLE = ("Consolas", 16, "bold")
FONT_SUBTITLE = ("Consolas", 8)
# ---------------- BINARY DETECTION ENGINE ----------------
def find_mysql_binary():
"""Scans system PATH and common installation directories for mysql binary."""
in_path = shutil.which("mysql")
if in_path:
return in_path
candidates = []
if sys.platform.startswith("linux"):
candidates = [
"/opt/lampp/bin/mysql",
"/usr/bin/mysql",
"/usr/local/bin/mysql",
"/usr/bin/mariadb"
]
elif sys.platform == "win32":
candidates = [
r"C:\xampp\mysql\bin\mysql.exe",
r"C:\laragon\bin\mysql\*\bin\mysql.exe",
r"C:\Program Files\MySQL\MySQL Server *\bin\mysql.exe",
r"C:\Program Files\MariaDB *\bin\mysql.exe"
]
elif sys.platform == "darwin":
candidates = [
"/Applications/XAMPP/xamppfiles/bin/mysql",
"/opt/homebrew/bin/mysql",
"/usr/local/bin/mysql"
]
for item in candidates:
if "*" in item:
matches = glob.glob(item)
if matches:
return sorted(matches)[-1]
elif os.path.exists(item):
return item
return ""
# ---------------- APPLICATION GUI ----------------
class CyberInjectorApp(tk.Tk):
def __init__(self):
super().__init__()
self.title("CYBER_SQL // BREACHER v2.0.77")
self.geometry("780x740")
self.minsize(720, 680)
self.configure(bg=C_BG_VOID)
self.mysql_bin = find_mysql_binary()
self.setup_ui()
self.check_initial_status()
def setup_ui(self):
header_frame = tk.Frame(self, bg=C_BG_VOID, padx=15, pady=10)
header_frame.pack(fill=tk.X)
title_lbl = tk.Label(
header_frame,
text="[ DATABASE OVERRIDE // SQL BREACHER ]",
fg=C_CYAN,
bg=C_BG_VOID,
font=FONT_TITLE,
anchor="w"
)
title_lbl.pack(anchor="w")
sub_lbl = tk.Label(
header_frame,
text="CORE ENGINE: NEUTRALIZING CONSTRAINTS // PROTOCOL: FOREIGN_KEY_CHECKS=0",
fg=C_PINK,
bg=C_BG_VOID,
font=FONT_SUBTITLE,
anchor="w"
)
sub_lbl.pack(anchor="w")
config_frame = tk.Frame(self, bg=C_PANEL, bd=1, relief=tk.SOLID, padx=15, pady=12)
config_frame.pack(fill=tk.X, padx=15, pady=5)
tk.Label(config_frame, text="// SOURCE SQL FILE", fg=C_CYAN, bg=C_PANEL, font=FONT_MONO_BOLD).grid(row=0, column=0, sticky="w", pady=(0, 2))
file_subframe = tk.Frame(config_frame, bg=C_PANEL)
file_subframe.grid(row=1, column=0, columnspan=4, sticky="we", pady=(0, 8))
config_frame.columnconfigure(0, weight=1)
self.ent_file = tk.Entry(file_subframe, bg=C_PANEL_ALT, fg=C_TEXT, insertbackground=C_CYAN, font=FONT_MONO, relief=tk.FLAT, bd=4)
self.ent_file.pack(side=tk.LEFT, fill=tk.X, expand=True, padx=(0, 8))
btn_browse = tk.Button(
file_subframe, text="[ BROWSE ]", command=self.browse_file,
bg=C_PANEL_ALT, fg=C_CYAN, activebackground=C_CYAN, activeforeground=C_BG_VOID,
font=FONT_MONO_BOLD, relief=tk.FLAT, bd=0, padx=10, cursor="hand2"
)
btn_browse.pack(side=tk.RIGHT)
tk.Label(config_frame, text="// TARGET DATABASE", fg=C_YELLOW, bg=C_PANEL, font=FONT_MONO_BOLD).grid(row=2, column=0, sticky="w", pady=(4, 2))
tk.Label(config_frame, text="// DETECTED MYSQL BINARY", fg=C_MUTED, bg=C_PANEL, font=FONT_MONO_BOLD).grid(row=2, column=1, columnspan=3, sticky="w", pady=(4, 2), padx=(10, 0))
self.ent_db = tk.Entry(config_frame, bg=C_PANEL_ALT, fg=C_YELLOW, insertbackground=C_YELLOW, font=FONT_MONO_BOLD, relief=tk.FLAT, bd=4)
self.ent_db.insert(0, "enterprise_core_db")
self.ent_db.grid(row=3, column=0, sticky="we", pady=(0, 8))
self.ent_bin = tk.Entry(config_frame, bg=C_PANEL_ALT, fg=C_TEXT, insertbackground=C_CYAN, font=FONT_MONO, relief=tk.FLAT, bd=4)
self.ent_bin.insert(0, self.mysql_bin)
self.ent_bin.grid(row=3, column=1, columnspan=3, sticky="we", pady=(0, 8), padx=(10, 0))
conn_frame = tk.Frame(config_frame, bg=C_PANEL)
conn_frame.grid(row=4, column=0, columnspan=4, sticky="we", pady=(4, 4))
for i in range(4): conn_frame.columnconfigure(i, weight=1)
tk.Label(conn_frame, text="HOST", fg=C_TEXT, bg=C_PANEL, font=FONT_MONO).grid(row=0, column=0, sticky="w")
tk.Label(conn_frame, text="PORT", fg=C_TEXT, bg=C_PANEL, font=FONT_MONO).grid(row=0, column=1, sticky="w", padx=4)
tk.Label(conn_frame, text="USER", fg=C_TEXT, bg=C_PANEL, font=FONT_MONO).grid(row=0, column=2, sticky="w", padx=4)
tk.Label(conn_frame, text="PASSWORD", fg=C_TEXT, bg=C_PANEL, font=FONT_MONO).grid(row=0, column=3, sticky="w")
self.ent_host = tk.Entry(conn_frame, bg=C_PANEL_ALT, fg=C_TEXT, insertbackground=C_CYAN, font=FONT_MONO, relief=tk.FLAT, bd=3)
self.ent_host.insert(0, "127.0.0.1")
self.ent_host.grid(row=1, column=0, sticky="we", padx=(0, 4), pady=(2, 0))
self.ent_port = tk.Entry(conn_frame, bg=C_PANEL_ALT, fg=C_TEXT, insertbackground=C_CYAN, font=FONT_MONO, relief=tk.FLAT, bd=3)
self.ent_port.insert(0, "3306")
self.ent_port.grid(row=1, column=1, sticky="we", padx=4, pady=(2, 0))
self.ent_user = tk.Entry(conn_frame, bg=C_PANEL_ALT, fg=C_TEXT, insertbackground=C_CYAN, font=FONT_MONO, relief=tk.FLAT, bd=3)
self.ent_user.insert(0, "root")
self.ent_user.grid(row=1, column=2, sticky="we", padx=4, pady=(2, 0))
self.ent_pass = tk.Entry(conn_frame, bg=C_PANEL_ALT, fg=C_TEXT, insertbackground=C_CYAN, font=FONT_MONO, show="*", relief=tk.FLAT, bd=3)
self.ent_pass.grid(row=1, column=3, sticky="we", padx=(4, 0), pady=(2, 0))
flags_frame = tk.Frame(config_frame, bg=C_PANEL)
flags_frame.grid(row=5, column=0, columnspan=4, sticky="w", pady=(10, 0))
self.var_drop = tk.BooleanVar(value=True)
chk_drop = tk.Checkbutton(
flags_frame, text="[ DROP IF EXISTS (PURGE BEFORE CREATION) ]",
variable=self.var_drop, bg=C_PANEL, fg=C_PINK, activebackground=C_PANEL,
activeforeground=C_PINK, selectcolor=C_BG_VOID, font=FONT_MONO
)
chk_drop.pack(side=tk.LEFT, padx=(0, 15))
self.var_fk = tk.BooleanVar(value=True)
chk_fk = tk.Checkbutton(
flags_frame, text="[ BYPASS FOREIGN KEYS (FORCE OVERRIDE) ]",
variable=self.var_fk, bg=C_PANEL, fg=C_GREEN, activebackground=C_PANEL,
activeforeground=C_GREEN, selectcolor=C_BG_VOID, font=FONT_MONO
)
chk_fk.pack(side=tk.LEFT)
self.btn_execute = tk.Button(
self, text=">>> INITIATE DATA INJECTION <<<", command=self.start_import_thread,
bg=C_PINK, fg="#ffffff", activebackground=C_CYAN, activeforeground=C_BG_VOID,
font=("Consolas", 12, "bold"), relief=tk.FLAT, bd=0, pady=8, cursor="hand2"
)
self.btn_execute.pack(fill=tk.X, padx=15, pady=(10, 5))
term_frame = tk.Frame(self, bg=C_PANEL, bd=1, relief=tk.SOLID, padx=10, pady=8)
term_frame.pack(fill=tk.BOTH, expand=True, padx=15, pady=(5, 15))
tk.Label(term_frame, text="// TERMINAL HUD & LIVE TELEMETRY", fg=C_GREEN, bg=C_PANEL, font=FONT_MONO_BOLD).pack(anchor="w")
self.txt_log = tk.Text(
term_frame, bg=C_BG_VOID, fg=C_GREEN, insertbackground=C_GREEN,
font=FONT_MONO, relief=tk.FLAT, bd=5, state=tk.DISABLED
)
self.txt_log.pack(fill=tk.BOTH, expand=True, pady=(5, 0))
def log(self, text, color=C_GREEN):
def _append():
self.txt_log.config(state=tk.NORMAL)
self.txt_log.insert(tk.END, text + "\n")
self.txt_log.see(tk.END)
self.txt_log.config(state=tk.DISABLED)
self.after(0, _append)
def browse_file(self):
f = filedialog.askopenfilename(
title="Select SQL Dump File",
filetypes=[("SQL Files", "*.sql"), ("All Files", "*.*")]
)
if f:
self.ent_file.delete(0, tk.END)
self.ent_file.insert(0, f)
size_mb = os.path.getsize(f) / (1024 * 1024)
self.log(f"[+] Loaded Dump: {os.path.basename(f)} ({size_mb:.2f} MB)", C_CYAN)
def check_initial_status(self):
self.log("===================================================================", C_MUTED)
self.log(" [SYS] CYBER_SQL BREACHER ONLINE // READY TO INJECT", C_CYAN)
self.log(f" [SYS] DETECTED PLATFORM: {sys.platform.upper()}", C_TEXT)
if self.mysql_bin:
self.log(f" [✓] DETECTED MYSQL BINARY: {self.mysql_bin}", C_GREEN)
else:
self.log(" [!] WARNING: MySQL binary not found automatically. Enter path manually.", C_ALERT)
self.log("===================================================================", C_MUTED)
def start_import_thread(self):
sql_file = self.ent_file.get().strip()
db_name = self.ent_db.get().strip()
mysql_bin = self.ent_bin.get().strip()
if not sql_file or not os.path.isfile(sql_file):
messagebox.showerror("Error", "Please select a valid .sql file.")
return
if not db_name:
messagebox.showerror("Error", "Specify a target database name.")
return
if not mysql_bin or not os.path.isfile(mysql_bin):
messagebox.showerror("Error", "Configured MySQL binary path does not exist.")
return
self.btn_execute.config(state=tk.DISABLED, bg=C_MUTED, text="INJECTING DATA...")
threading.Thread(target=self.run_process, daemon=True).start()
def run_process(self):
sql_file = self.ent_file.get().strip()
db_name = self.ent_db.get().strip()
mysql_bin = self.ent_bin.get().strip()
host = self.ent_host.get().strip()
port = self.ent_port.get().strip()
user = self.ent_user.get().strip()
pwd = self.ent_pass.get().strip()
drop = self.var_drop.get()
bypass_fk = self.var_fk.get()
base_cmd = [mysql_bin, "-h", host, "-P", port, "-u", user]
if pwd:
base_cmd.append(f"-p{pwd}")
try:
# 1. Environment prep
self.log(f"[*] PREPARING ENVIRONMENT FOR: `{db_name}`...", C_YELLOW)
queries = []
if drop:
queries.append(f"DROP DATABASE IF EXISTS `{db_name}`;")
queries.append(f"CREATE DATABASE IF NOT EXISTS `{db_name}` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;")
res = subprocess.run(base_cmd + ["-e", " ".join(queries)], capture_output=True, text=True)
if res.returncode != 0:
self.log(f"[!] ERROR CREATING SCHEMA:\n{res.stderr}", C_ALERT)
self.restore_button()
return
self.log(f"[✓] SCHEMA `{db_name}` ONLINE.", C_GREEN)
# 2. Injection pipeline with expanded packet buffers
file_size_mb = os.path.getsize(sql_file) / (1024 * 1024)
self.log(f"[*] STREAMING SQL DATA: {file_size_mb:.2f} MB...", C_CYAN)
import_cmd = [mysql_bin, "--max_allowed_packet=128M", "-h", host, "-P", port, "-u", user, db_name]
if pwd:
import_cmd.insert(-1, f"-p{pwd}")
proc = subprocess.Popen(import_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
try:
proc.stdin.write(b"SET NAMES utf8mb4;\n")
if bypass_fk:
proc.stdin.write(b"SET FOREIGN_KEY_CHECKS=0;\n")
proc.stdin.write(b"SET UNIQUE_CHECKS=0;\n")
proc.stdin.flush()
# Streaming in 1 MB chunks to maintain constant RAM profile
with open(sql_file, "rb") as f:
while chunk := f.read(1024 * 1024):
proc.stdin.write(chunk)
proc.stdin.flush()
if bypass_fk:
proc.stdin.write(b"\nSET FOREIGN_KEY_CHECKS=1;\n")
proc.stdin.write(b"SET UNIQUE_CHECKS=1;\n")
proc.stdin.flush()
except (BrokenPipeError, IOError):
self.log("[!] Database process unexpectedly closed the socket.", C_ALERT)
finally:
# Key trick to avoid 'flush of closed file'
try:
if proc.stdin and not proc.stdin.closed:
proc.stdin.close()
except Exception:
pass
proc.stdin = None
_, stderr = proc.communicate()
if proc.returncode == 0:
self.log(f"[✓✓✓] INJECTION FINISHED WITH ZERO ERRORS IN `{db_name}`.", C_GREEN)
self.after(0, lambda: messagebox.showinfo("Success", f"Database `{db_name}` successfully imported."))
else:
self.log(f"[!] IMPORT FAILED:\n{stderr.decode('utf-8', errors='replace')}", C_ALERT)
except Exception as e:
self.log(f"[!] SYSTEM EXCEPTION: {str(e)}", C_ALERT)
self.restore_button()
def restore_button(self):
def _restore():
self.btn_execute.config(state=tk.NORMAL, bg=C_PINK, text=">>> INITIATE DATA INJECTION <<<")
self.after(0, _restore)
if __name__ == "__main__":
app = CyberInjectorApp()
app.mainloop()
🥊 The Two Technical Traps That Almost Broke Us
When you write software that manipulates low-level OS processes, you inevitably run into edge cases. Here are the two bugs that made us sweat and how we took them down:
1. The flush of closed file Nightmare 💥
In Python's subprocess module, if you manually call proc.stdin.close() to signal an EOF to the MySQL client, and subsequently call proc.communicate(), Python thinks: "Let me flush stdin before waiting for the process to exit." But because stdin is already closed, it blows up with:
ValueError: flush of closed file
The Fix: Right after closing the stream, explicitly set proc.stdin = None. When communicate() sees that the attribute is None, it skips the flush attempt and proceeds straight to reading stderr. Problem solved.
2. The PEP 668 Wall in Modern Linux 🐧
On modern Linux distributions (Ubuntu 24.04+, Debian 12+), running pip install pyinstaller gets slammed by the OS package manager:
error: externally-managed-environment
× This environment is externally managed
The system locks down global Python packages to prevent system libraries from breaking. Worse, if your environment has legacy Python 2.7 remnants in /usr/local/bin, broken pip shims will run with the wrong interpreter and throw fatal syntax errors during setup.
The Fix: Build an automated packaging script that spins up an ephemeral virtual environment (python3 -m venv .build_venv), installs PyInstaller in isolation, compiles the bundle, and cleans up after itself.
📦 Packaging for Everyone: AppImage & .EXE
Python scripts are great for developers, but if you need to hand this tool to a teammate who doesn't know what a terminal is, you want a single executable they can double-click.
For Linux: build_appimage.sh
This script provisions an isolated venv, builds the standalone binary with PyInstaller, constructs the AppDir with an SVG icon, pulls appimagetool, and produces an .AppImage ready to run anywhere:
#!/usr/bin/env bash
set -e
APP_NAME="CyberSQLInjector"
BIN_NAME="cyber_import"
VERSION="2.0.77"
APP_DIR="AppDir"
VENV_DIR=".build_venv"
echo -e "\e[1;36m[*] Configuring isolated build venv...\e[0m"
python3 -m venv "$VENV_DIR"
"$VENV_DIR/bin/pip" install --upgrade pip pyinstaller
echo -e "\e[1;36m[*] Building binary with bundled Tkinter...\e[0m"
"$VENV_DIR/bin/pyinstaller" --noconfirm --onedir --windowed \
--name "$BIN_NAME" \
--collect-all tkinter \
cyber_import.py
echo -e "\e[1;36m[*] Assembling AppDir structure...\e[0m"
rm -rf "$APP_DIR"
mkdir -p "$APP_DIR/usr/bin" "$APP_DIR/usr/share/icons/hicolor/scalable/apps"
cp -r "dist/$BIN_NAME"/* "$APP_DIR/usr/bin/"
cat << 'EOF' > "$APP_DIR/cyber_import.svg"
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128">
<rect width="128" height="128" fill="#08090d" rx="20"/>
<rect x="14" y="24" width="100" height="80" fill="#10121b" stroke="#00f0ff" stroke-width="3" rx="8"/>
<text x="64" y="62" fill="#00ff75" font-family="monospace" font-size="16" font-weight="bold" text-anchor="middle">> CYBER_SQL</text>
<circle cx="64" cy="82" r="5" fill="#ff0055"/>
</svg>
EOF
cp "$APP_DIR/cyber_import.svg" "$APP_DIR/usr/share/icons/hicolor/scalable/apps/cyber_import.svg"
cat << 'EOF' > "$APP_DIR/cyber_import.desktop"
[Desktop Entry]
Name=Cyber SQL Breacher
Exec=cyber_import
Icon=cyber_import
Type=Application
Categories=Development;Database;
Terminal=false
EOF
cat << 'EOF' > "$APP_DIR/AppRun"
#!/bin/sh
SELF=$(readlink -f "$0")
HERE=${SELF%/*}
export PATH="${HERE}/usr/bin:${PATH}"
export LD_LIBRARY_PATH="${HERE}/usr/bin:${LD_LIBRARY_PATH}"
exec "${HERE}/usr/bin/cyber_import" "$@"
EOF
chmod +x "$APP_DIR/AppRun"
echo -e "\e[1;36m[*] Fetching appimagetool and compiling...\e[0m"
if [ ! -f "appimagetool" ]; then
curl -sL -o appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
chmod +x appimagetool
fi
ARCH=x86_64 ./appimagetool --appimage-extract-and-run "$APP_DIR" "${APP_NAME}-${VERSION}-x86_64.AppImage"
rm -rf build dist "$BIN_NAME.spec" "$APP_DIR" "$VENV_DIR"
echo -e "\e[1;32m[✓] AppImage compiled successfully!\e[0m"
For Windows: build_exe.bat
On Windows, this simple batch script bundles everything into a single .exe file (--onefile) and hides the background CMD window (--windowed):
@echo off
setlocal
cd /d "%~dp0"
title CYBER_SQL // EXE BUILDER
pip install pyinstaller
if exist "build" rd /s /q "build"
if exist "dist" rd /s /q "dist"
pyinstaller --noconfirm --onefile --windowed ^
--name "CyberSQLInjector" ^
--collect-all tkinter ^
cyber_import.py
echo.
echo ===================================================
echo [OK] Binary built in: dist\CyberSQLInjector.exe
echo ===================================================
pause
🌐 Where Do I Get It?
The entire project is open-source under the MIT license. No telemetry, no paid tiers, and no background bloat.
GitHub Repository:
github.com/julio101290/cyber-sql-breacher Pre-compiled Downloads: Head over to the
Releases section to grab the ready-to-run.AppImagefor Linux or.exefor Windows without having to install Python.
Next time MySQL throws Error 150 in your face, don't punch your desk: clone the repository, click Bypass Foreign Keys, and let raw byte streaming handle the dirty work while you sit back and enjoy your coffee.


Comments
Post a Comment