python · tkinter · mysql

A small, honest way to
manage employee records.

No web server, no bloat, no dashboard you didn't ask for. Just a clean desktop app for adding, updating, searching, and reporting on employee data — backed by a real MySQL table.

EmployeeManagementSystem.exe
idnamepositionsalary
01A. KapoorEngineer₹82,000
02R. ChenDesigner₹74,500
03S. AlvarezManager₹96,200
what it does

Every feature maps to one SQL operation

Nothing hidden behind the UI — each button in the app corresponds directly to a query running against your employees table.

INSERT INTO

Add new employees

Create a new record with name, position, and salary in one form.

UPDATE ... SET

Update selected details

Edit any field on an existing employee and save the change instantly.

DELETE FROM

Delete employees safely

Remove a record with a confirmation step so nothing is lost by accident.

SELECT ... WHERE

Search by name or position

Filter the table live as you type, no separate search screen needed.

ORDER BY

Sort by any column

Click a column header to sort records ascending or descending.

SUM(salary)

Salary summary totals

See the total payroll for the currently filtered set of employees.

tech stack

Built with plain, dependable tools

Python 3.9+ Tkinter (desktop UI) MySQL / MariaDB mysql-connector-python PyInstaller
getting started

Set it up in under five minutes

Prerequisites: Python installed and on PATH, a running MySQL server (XAMPP works well locally), and pip.

Windows
macOS / Linux

Install Python and MySQL

Grab Python from python.org (enable "Add to PATH"), then install XAMPP and start Apache + MySQL from its control panel.

Create the database

Import Database_Schema.sql through phpMyAdmin, or run the schema SQL manually — see the schema section below.

Set environment variables

Run enviroment.bat, or set DB_HOST, DB_USER, DB_PASSWORD, and DB_NAME yourself.

Run the setup script

Double-click setup.bat — it installs dependencies, imports the schema if needed, and launches the app.

cmd.exe
:: one-click setup and launch
setup.bat

Install Python and MySQL

Install Python 3.9+ and a local MySQL/MariaDB server, or use XAMPP for a quick local setup.

Create the database

Import Database_Schema.sql through phpMyAdmin, or run the schema SQL manually — see the schema section below.

Set environment variables

Source enviroment.zsh, or export DB_HOST, DB_USER, DB_PASSWORD, and DB_NAME yourself.

Run the setup script

Make it executable and run it — it installs dependencies, imports the schema if needed, and launches the app.

zsh
# one-click setup and launch
chmod +x setup.sh
./setup.sh
configuration

Environment variables

The app never hardcodes credentials — it reads them from your shell environment at launch.

CMD
PowerShell
zsh / bash
cmd.exe
set DB_HOST=localhost
set DB_USER=root
set DB_PASSWORD=
set DB_NAME=Employees
powershell
$env:DB_HOST="localhost"
$env:DB_USER="root"
$env:DB_PASSWORD=""
$env:DB_NAME="Employees"
zsh
export DB_HOST=localhost
export DB_USER=root
export DB_PASSWORD=
export DB_NAME=Employees
database

The employees table

One table, six columns. Import Database_Schema.sql in phpMyAdmin, or run this directly in MySQL.

Database_Schema.sql
CREATE DATABASE IF NOT EXISTS Employees
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci;

USE Employees;

CREATE TABLE IF NOT EXISTS employees (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100) NOT NULL,
    position VARCHAR(100) NOT NULL,
    salary DECIMAL(10, 2) NOT NULL CHECK (salary >= 0),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB;
id PKINT, auto-increment
nameVARCHAR(100)
positionVARCHAR(100)
salaryDECIMAL(10,2), ≥ 0
created_atTIMESTAMP
updated_atTIMESTAMP, auto
packaging

Build a standalone .exe

A PyInstaller spec file ships with the project, so most people won't need the manual command.

using the spec file
pyinstaller --clean EmployeeManagementSystem.spec
manual build
pyinstaller --onefile --windowed \
  --icon app.ico \
  --add-data "app.png;." \
  --add-data "app.ico;." \
  --name EmployeeManagementSystem main.py

On macOS/Linux, replace the semicolons in --add-data with colons. Output lands in dist/.

troubleshooting

When something doesn't start

ModuleNotFoundError: mysql.connector+
The connector isn't installed in your active environment. Run pip install mysql-connector-python and try again.
Database connection failed+
Check that MySQL is running, that DB_HOST, DB_USER, and DB_PASSWORD are correct, and that the database in DB_NAME actually exists.
App can't find the database+
Confirm the name in DB_NAME matches the database you created — it defaults to Employees.
pyinstaller: command not found+
PyInstaller isn't installed yet. Run pip install pyinstaller, then re-run your build command.