This is just a rant writing. Because how difficult tutorial out there just to setup this kind of thing. So I'm here to summarize for you (reader) how to get it done.
Simple! Run:
docker run --name mysql-local -p 3306:3306 -e MYSQL_ROOT_PASSWORD=admin -d mysql
-
mysql-local
: Your container name, feel free to change it. -
-p 3306:3306
: Expose container to localhost, so we can connect with UI (ex: DBeaver). -
-e MYSQL_ROOT_PASSWORD=admin
:root
user password, adjust with your preference. -
-d
: Detach mode -
mysql
: Image name
This will automatically pull the image if not pulled yet.
Connecting into interface (or else)
After this, maybe you need to access via UI. Here is the setting:
- Host: localhost
- Port: 3306
- User: root
- Password: admin
Maybe you will need this
- When connecting, maybe you will get error
Public Key Retrieval is not allowed
. If you are using DBeaver, search for driver properties/setting. ChangeallowPublicKeyRetrieval = true
Closing
That it and Thank You.
Top comments (0)