This program works perfectly without a database. But if you'd like to track every file that's been organized, you can install MySQL and the program will automatically log operations to it.
With MySQL installed, the program records:
- Every file processed (original name, new name, type, date taken)
- Usage history (when the program was run, how many times)
Without MySQL, the program runs exactly the same — no errors, no warnings.
sudo bash scripts/install-mysql-linux.shbash scripts/install-mysql-macos.shscripts\install-mysql-windows.batEach script:
- Installs MySQL server
- Creates an
imagingdatabase - Creates tables (
file_log,usage_log) - Sets up a user:
imaging/imaging2024
Once MySQL is available on localhost:3306, the program automatically:
- Detects the database at startup
- Logs each moved file to
file_log - Records each run to
usage_log
If MySQL is not running or not installed, the program skips database logging silently.
| Setting | Value |
|---|---|
| Host | localhost |
| Port | 3306 |
| Database | imaging |
| User | imaging |
| Password | imaging2024 |
| JDBC URL | jdbc:mysql://localhost:3306/imaging |
CREATE TABLE file_log (
id INT AUTO_INCREMENT PRIMARY KEY,
original_name VARCHAR(512),
new_name VARCHAR(512),
file_type VARCHAR(10),
date_taken DATETIME,
source_path VARCHAR(1024),
dest_path VARCHAR(1024),
processed_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE usage_log (
id INT AUTO_INCREMENT PRIMARY KEY,
run_count INT,
run_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);The program uses Java's built-in java.sql package. MySQL Connector/J is loaded at runtime only if MySQL is present. If you installed MySQL via the scripts above, the connector is included automatically.
To manually add the connector:
- Download from https://dev.mysql.com/downloads/connector/j/
- Place
mysql-connector-j-*.jarin the project root - Run with:
java -cp "out:mysql-connector-j-*.jar" pennywise.Main src/pennywise/config.xml