Skip to content

Professional Electron-based MySQL database management tool with multi-database support, Monaco editor, and AG Grid

Notifications You must be signed in to change notification settings

bulgariamitko/mysql-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MySQL Manager

A professional Electron-based MySQL database management application with advanced features for viewing, editing, and managing multiple MySQL databases simultaneously.

License Node Electron

✨ Features

Core Features

  • Multi-Database Support - Connect to multiple MySQL databases simultaneously
  • Advanced SQL Editor - Monaco Editor with syntax highlighting, autocomplete, and IntelliSense
  • Data Grid - AG Grid with inline editing, sorting, filtering, and pagination
  • Schema Explorer - Browse tables, views, procedures, functions, and triggers
  • Auto-Refresh - Automatically refresh query results at configurable intervals
  • Dark/Light Mode - Automatic theme switching based on system preference

Query Editor

  • SQL syntax highlighting and formatting
  • Table and column autocomplete
  • Execute entire query or selected text
  • Query history tracking
  • Multi-tab support (planned)

Data Grid

  • Inline cell editing
  • Add/delete rows
  • Column filtering and sorting
  • Copy data (selected rows or all)
  • Export to JSON, CSV, XLSX
  • Virtual scrolling for large datasets

Schema Explorer

  • View all tables with row counts
  • Browse table structure
  • View indexes and foreign keys
  • Context menu for common operations
  • Quick table data preview

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher) - Download
  • npm (comes with Node.js)
  • MySQL databases accessible via localhost or SSH tunnels

πŸš€ Quick Start

1. Clone the repository

git clone https://github.com/bulgariamitko/mysql-manager.git
cd mysql-manager

2. Install dependencies

npm install

3. Configure your databases

Copy the example environment file:

cp .env.example .env

Edit .env and add your database configurations:

# Database 1
DB1_NAME=Production
DB1_HOST=127.0.0.1
DB1_PORT=3306
DB1_USER=your_username
DB1_PASSWORD=your_password
DB1_DATABASE=your_database

# Database 2
DB2_NAME=Staging
DB2_HOST=127.0.0.1
DB2_PORT=3307
DB2_USER=your_username
DB2_PASSWORD=your_password
DB2_DATABASE=your_database

# Add more databases (DB3, DB4, etc.) as needed

⚠️ Important: If your password contains special characters (like #, $, &, *, (, ), [, ], {, }, etc.), wrap it in double quotes:

DB1_PASSWORD="my}P@ss#word!"

See .env.example for a complete list of special characters that require quoting.

4. Run the application

npm run dev

The application will:

  1. Start the Vite development server
  2. Launch the Electron application
  3. Test database connections
  4. Open DevTools automatically

πŸ”§ Configuration

Database Configuration

The application supports up to 10 databases (DB1 through DB10). Each database requires:

Variable Required Default Description
DB{N}_NAME Yes - Display name for database
DB{N}_HOST No 127.0.0.1 Database host
DB{N}_PORT No 3306 Database port
DB{N}_USER No root MySQL username
DB{N}_PASSWORD No (empty) MySQL password
DB{N}_DATABASE No Same as NAME Database name

Note: {N} can be 1 through 10 (DB1, DB2, DB3, etc.)

SSH Tunnels

If your databases are remote, set up SSH tunnels first:

# Create SSH tunnel
ssh -L 3307:localhost:3306 user@remote-server.com

# Or run in background
ssh -L 3307:localhost:3306 -f -N user@remote-server.com

Then configure your .env to use the tunnel port:

DB1_PORT=3307

πŸ“¦ Building for Production

Build for current platform

npm run build

This creates:

  • Optimized React bundle in dist/
  • Packaged Electron app in release/

Build for macOS only

npm run build:mac

Creates a .dmg installer and .app bundle for macOS.

πŸ› οΈ Development

Project Structure

mysql-manager/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/                 # Electron main process
β”‚   β”‚   β”œβ”€β”€ index.js         # Main entry point
β”‚   β”‚   β”œβ”€β”€ preload.js       # Preload script
β”‚   β”‚   └── database/        # Database logic
β”‚   β”‚       β”œβ”€β”€ connection-pool.js
β”‚   β”‚       └── query-executor.js
β”‚   β”œβ”€β”€ renderer/            # React UI
β”‚   β”‚   β”œβ”€β”€ App.jsx         # Main app component
β”‚   β”‚   β”œβ”€β”€ components/     # React components
β”‚   β”‚   └── index.jsx       # React entry point
β”‚   └── shared/             # Shared code
β”‚       └── database-config.js
β”œβ”€β”€ .env                    # Database credentials (gitignored)
β”œβ”€β”€ .env.example           # Example configuration
β”œβ”€β”€ package.json
└── vite.config.js

Available Scripts

  • npm run dev - Start in development mode
  • npm run build - Build for production
  • npm run build:mac - Build macOS installer
  • npm start - Start production build

πŸ› Troubleshooting

Database Connection Issues

Problem: ❌ Connection failed errors

Solutions:

  1. Verify SSH tunnels are running (if using remote databases):

    lsof -i :3307  # Check if port is in use
  2. Test database connection manually:

    mysql -h 127.0.0.1 -P 3307 -u your_user -p
  3. Check .env file for typos in credentials

  4. Ensure passwords with special characters are quoted

App Won't Start

Problem: Electron app doesn't launch

Solutions:

  1. Clear node_modules and reinstall:

    rm -rf node_modules package-lock.json
    npm install
  2. Check Node.js version:

    node --version  # Should be v18+
  3. Look for errors in terminal output

Port Already in Use

Problem: Error: listen EADDRINUSE: address already in use :::5173

Solutions:

  1. Kill the process using port 5173:

    lsof -ti:5173 | xargs kill -9
  2. Or change the Vite port in vite.config.js

πŸ” Security Best Practices

  1. Never commit .env files - Always use .env.example for documentation
  2. Use SSH tunnels for remote database access instead of exposing ports
  3. Rotate credentials regularly - Especially for production databases
  4. Limit database permissions - Create read-only users when possible
  5. Use strong passwords - Minimum 16 characters with mixed case, numbers, and symbols

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License.

πŸ†˜ Support

If you encounter issues:

  1. Check the Troubleshooting section
  2. Search existing issues
  3. Create a new issue with:
    • Environment details (OS, Node version)
    • Error messages
    • Steps to reproduce

πŸ“š Documentation

For detailed setup instructions, see SETUP.md.

⭐ Show Your Support

Give a ⭐️ if this project helped you!


Built with:

About

Professional Electron-based MySQL database management tool with multi-database support, Monaco editor, and AG Grid

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •