Version: 0.1.1
A desktop app (PySide6) for browsing and editing MySQL databases visually: connect to a server, pick a database, pick a table, see it as an editable grid, and either edit cells directly, use a guided form-based command builder, or drop into raw SQL.
This app is meant to be distributed as a compiled application: a Windows
.exe and an Ubuntu .deb, both attached to the GitHub releases. End users
should not need Python installed. The source code can also be run directly
(see below) for development and testing.
cd mysql-db-manager
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txtpython main.pyRunning the raw code works fine and is the easiest way to test changes: edit, re-run, repeat. The compiled builds below are what get distributed.
app/
db/
connection.py # connect/execute wrapper around mysql-connector-python
introspect.py # SHOW DATABASES / SHOW TABLES / DESCRIBE
query_builder.py # builds parameterized INSERT/UPDATE/DELETE/CREATE USER
table_model.py # the editable grid's data model
ui/
login_page.py # host/port/user/password + saved profiles
db_browser_page.py # pick a database
table_browser_page.py # pick a table
table_view_page.py # the grid + guided commands + raw SQL, as tabs
command_panel.py # the guided, form-based command builder
sql_box.py # raw SQL escape hatch
main_window.py # menu bar + page routing + app state
config/
credentials_store.py # saved profiles (JSON) + passwords (OS keyring)
main.py # entry point
- Connect: fill in host/port/username/password. Check "Save this
connection" to store it -- the password goes into your OS's secure
credential store (Windows Credential Manager / Linux Secret Service via
the
keyringlibrary), never into a plain text file. - Pick a database, then pick a table. Each list also has a
New Database... / New Table... button -- the latter opens a
dialog where you define columns (name, type, length, nullable, primary
key, auto-increment, default) and it builds the
CREATE TABLEfor you. - Table Data tab: the grid shows the table live. Edit any existing cell
and it commits as an
UPDATEas soon as you move off it. Type into the bottom row (marked*) to add a new row -- it commits as anINSERTonce you click away from it. - Guided Commands tab: pick INSERT/UPDATE/DELETE, fill in the labeled fields (built from the table's own columns), hit Run. No SQL typing required.
- Raw SQL tab: type anything and run it, for when you need something the guided builder doesn't cover.
- Menu bar: Account menu has Create New User and Manage Permissions (both only enabled when logged in as root), Switch User/Reconnect, and Disconnect. Navigate menu lets you jump back to pick a different database or table at any time.
- Manage Permissions: pick a user (existing ones are listed, or type a
new one), a database/table scope (or "all"), check the privileges you
want, and hit Grant -- builds and runs the
GRANTplusFLUSH PRIVILEGESfor you. "Show Current Grants" runsSHOW GRANTS FORso you can see what a user already has before changing anything.
- Editing a cell only works on tables that have a primary key (needed to
target the right row for the
UPDATE). Tables without one will show an error if you try to edit a cell -- use the Raw SQL tab for those. CREATE USERrequires appropriate privileges on the server (typically root, or any account grantedCREATE USER).- All identifiers (database/table/column names) used in generated SQL come
from the server itself (
SHOW DATABASES/SHOW TABLES/DESCRIBE), and all values are sent as query parameters -- never string-concatenated -- so normal use doesn't risk SQL injection.
The app is compiled with PyInstaller. Build on each target OS separately -- PyInstaller doesn't cross-compile.
Windows .exe (run on a Windows machine, in PowerShell):
.venv\Scripts\Activate.ps1
pip install pyinstaller
packaging\windows\build_exe.ps1The exe lands at dist\MySQLDBManager-<version>.exe, with the version taken
from VERSION.
Ubuntu .deb (run on an Ubuntu machine). A script runs PyInstaller and
then packages the binary with dpkg-deb:
source .venv/bin/activate
pip install pyinstaller
packaging/deb/build_deb.shThe package lands at dist/mysql-db-manager_<version>_<arch>.deb, with the
version taken from VERSION. Install it with:
sudo apt install ./dist/mysql-db-manager_<version>_<arch>.debThe package's Depends: list (in packaging/deb/control.in) covers the
system libraries Qt needs on Ubuntu. If the app fails to start on a clean
machine, check that list first.
If PyInstaller complains about missing Qt plugins, add --collect-all PySide6
to the PyInstaller command in packaging/deb/build_deb.sh.
Compiled builds are uploaded to the GitHub repository's releases.