Skip to content

MazyLawzey/mysql-vsc-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MySQL VSC Server πŸ—„οΈ

A powerful VS Code extension to manage MySQL Server instances using Docker directly from your editor.

VS Code Extension Version GitHub

✨ Features

  • πŸš€ Start/Stop MySQL Server - Easily manage your MySQL instance with one click
  • πŸ“¦ Create Databases - Create new databases with custom users and passwords
  • πŸ’Ύ Persistent Data - Your data is saved in a Docker volume and persists between sessions
  • βš™οΈ Configurable - Customize port, password, MySQL version, and data location
  • πŸ“Š Live Status - See your server status in the status bar
  • 🌳 Tree View - Manage databases directly from the sidebar
  • πŸ”” Notifications - Get feedback for all actions

πŸ“‹ Requirements

πŸš€ Quick Start

1. Install the Extension

  • Open VS Code
  • Go to Extensions (Cmd+Shift+X / Ctrl+Shift+X)
  • Search for "MySQL VSC Server"
  • Click Install

2. Open MySQL Docker Manager

  • Look for the database icon (πŸ—„οΈ) in the Activity Bar (left sidebar)
  • Click it to open MySQL Docker Manager

3. Start Your Server

  • Click the ▢️ Start Server button
  • MySQL will be downloaded and started (first time takes a minute)

4. Create a Database

  • Click βž• Create Database
  • Enter:
    • Database name
    • Database user
    • Database password
  • Done! Your database is ready

5. Connect to Your Database

Use any MySQL client:

Host:     localhost
Port:     3306
Username: your_user
Password: your_password
Database: your_database

Popular clients:

🎯 Commands

All commands are available in the MySQL Docker Manager sidebar:

Command Button Action
Start Server ▢️ Start MySQL Docker container
Stop Server ⏹️ Stop MySQL Docker container
Create Database βž• Create new database with user
View Status ℹ️ Show server status and info
Configure Settings βš™οΈ Change port, password, version

βš™οΈ Configuration

Click βš™οΈ Settings to customize:

  • Port - Default: 3306
  • Root Password - Default: root
  • MySQL Version - Default: latest
  • Container Name - Default: vscode-mysql

πŸ’Ύ Data Persistence

All your data is automatically saved in a Docker named volume called vscode-mysql-data.

This approach works seamlessly on:

  • βœ… Windows (Docker Desktop)
  • βœ… macOS (Intel & Apple Silicon)
  • βœ… Linux (all distributions)

Why Docker volumes?

  • No path issues across different operating systems
  • Data is managed by Docker
  • No manual directory creation needed
  • Works with Docker Desktop and Docker Engine

When you stop the server:

  • βœ… Data is preserved
  • βœ… Container is paused
  • βœ… You can restart anytime

When you start the server again:

  • βœ… All previous data is restored
  • βœ… Same databases and users are available
  • βœ… No data loss!

πŸ› οΈ Technology Stack

  • Language: TypeScript
  • API: VS Code Extension API
  • Runtime: Docker
  • Database: MySQL
  • Build: esbuild

πŸ“¦ What's Inside

src/
β”œβ”€β”€ extension.ts              # Main extension entry point
β”œβ”€β”€ commands/
β”‚   └── index.ts              # All 5 commands
β”œβ”€β”€ docker/
β”‚   └── dockerManager.ts      # Docker container management
β”œβ”€β”€ config/
β”‚   └── configManager.ts      # Configuration management
└── ui/
    β”œβ”€β”€ statusBarManager.ts   # Status bar component
    └── treeDataProvider.ts   # Sidebar tree view

πŸŽ“ Examples

Node.js Connection

const mysql = require('mysql2/promise');

const connection = await mysql.createConnection({
  host: 'localhost',
  user: 'your_user',
  password: 'your_password',
  database: 'your_database'
});

Python Connection

import mysql.connector

conn = mysql.connector.connect(
    host="localhost",
    user="your_user",
    password="your_password",
    database="your_database"
)

PHP Connection

$conn = new mysqli(
    "localhost",
    "your_user",
    "your_password",
    "your_database"
);

πŸ› Troubleshooting

Docker not found

Error: docker command not found
Solution: Install Docker from https://www.docker.com/products/docker-desktop

Docker daemon not running

Error: Cannot connect to Docker daemon
Solution: Open Docker Desktop application

Port already in use

Error: Port 3306 already in use
Solution: Change port in Settings (βš™οΈ)

Can't connect to database

Check:

  1. Server status (ℹ️ View Status)
  2. Correct host (localhost)
  3. Correct port (default 3306)
  4. Correct username and password

Data loss

If you deleted the container but .vscode-mysql-data folder exists:

  1. Click ▢️ Start Server
  2. Extension will create new container and restore your data

πŸ“Š Stats

  • Version: 0.1.0
  • Size: 61 KB
  • Dependencies: 0 (uses Node.js built-ins)
  • License: GNU GPL 3.0
  • Author: mazylawzey

πŸ”— Links

πŸ’‘ Tips

  1. Use strong passwords in production environments
  2. Backup important data regularly
  3. Check disk space - databases can grow large
  4. Monitor logs - docker logs vscode-mysql
  5. Use version control for your database scripts

πŸš€ Future Features

  • MariaDB support
  • Database backup/restore
  • SQL query editor
  • Visual database designer
  • PostgreSQL support
  • Export/Import databases
  • Database snapshots
  • Multi-server management

πŸ“ License

GNU GPL 3.0 Β© 2026 mazylawzey

🀝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest features
  • Submit pull requests

❓ Support

If you encounter any issues:

  1. Check Troubleshooting section
  2. Check Docker is installed and running
  3. Review Docker logs: docker logs vscode-mysql
  4. Open an issue on GitHub

Made with ❀️ for developers

Quick Links


If you find this extension helpful, please give it a ⭐ on GitHub!

About

A powerful VS Code extension to manage MySQL Server instances using Docker directly from your editor.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors