Skip to content
| Marketplace
Sign in
Visual Studio Code>Data Science>MySQL VSC ServerNew to Visual Studio Code? Get it now.
MySQL VSC Server

MySQL VSC Server

Mazy Lawzey

|
5 installs
| (1) | Free
Manage MySQL Server instances using Docker directly from VS Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

MySQL VSC Server 🗄️

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

VS Code Extension License: MIT 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

  • VS Code version 1.85.0 or higher
  • Docker version 20.0 or higher
    • Docker Desktop for Mac
    • Docker Desktop for Windows
    • Docker Engine for Linux

🚀 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:

  • DBeaver Community
  • MySQL Workbench
  • Command line: mysql -h localhost -u your_user -p

🎯 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: MIT
  • Author: mazylawzey

🔗 Links

  • GitHub Repository
  • VS Code Extension
  • Docker Documentation
  • MySQL Documentation

💡 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

MIT © 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

  • Installation
  • Commands
  • Configuration
  • Troubleshooting

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

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft