DEV Community

Ayra Jett for Bytebase

Posted on • Originally published at bytebase.com

2 2 2 2 2

Run a Local 💻 MySQL 🐬 Instance

This document describes how to run a MySQL instance locally with Docker and how to add it as an Instance for testing purpose.

Step 1 - Start a local MySQL server in Docker

  1. Start Docker.
  2. Run the command in the terminal

    docker run --name mysqld \
      --publish 3306:3306 \
      -e MYSQL_ROOT_HOST=172.17.0.1 \
      -e MYSQL_ROOT_PASSWORD=testpwd1 \
      mysql/mysql-server:8.0
    

The setup below is for testing purpose and should NOT be used in production setup. Also the MySQL data will be wiped out after the container stops.

Step 2 - Add the MySQL Server as an Instance

  1. Click Instances on the top bar.
  2. Click Add Instance on the instances page, and you will see Create Instance dialog box.
  3. Fill the fields as follows:
    • Choose MySQL
    • Instance Name: MySQL Docker for Test
    • Environment: Test
    • Host or Socket: host.docker.internal
    • Port: 3306
    • Username: root
    • Password: testpwd1
  4. Click Create, and you can see the newly added instance in the table.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Billboard image

Try REST API Generation for Snowflake

DevOps for Private APIs. Automate the building, securing, and documenting of internal/private REST APIs with built-in enterprise security on bare-metal, VMs, or containers.

  • Auto-generated live APIs mapped from Snowflake database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay