Spinning MySQL Database with Docker

preview_player
Показать описание


In this video we will learn how to spin up a mysql database using docker.

Docker is the best and easiest way to practice, develop and learn. Instead of worrying about downloading, installing and configuring database. You can quickly spin a container do your testing and development then just spin it down.

We will use this video as a reference for our coding series where we can write python code or Javascript code that hits this mysql database.

Lets do this!

#MYSQL
docker run --name ms -p 3306:3306 -e MYSQL_ROOT_PASSWORD=password mysql

bash into the container to run mysql
docker exec -it ms bash

run mysql
mysql -u root -ppassword (no space between -p and password)

Stay Awesome!
Hussein
Рекомендации по теме
Комментарии
Автор

Decided to pick up software development during the pandemic and I just found this video after a weekend of struggling and failing numerous times to get MySQL to work with docker and I'm astounded! Such a clean, simple, easily digestable lesson and I was able to get a database going super fast after fixing the mistakes I realized I was making, definitely one of my fastest subscriptions ✊🏼✊🏼

thatsmallcog
Автор

Thank you so much. I was looking for this. Keep posting backend stuff.

manasyadav
Автор

Thanks Hussein, I was able to get mine running on the first attempt.

vern
Автор

Thanks so much. This was really helpful!! Everything makes sense to me now 😀

alexiacodes
Автор

Thank you so much. Everything makes sens to me right now

MaromonLup
Автор

Another great tutorial. Sheds a lot of light on what Docker is and does. 🙌 Request for MongoDB/Mongoose for Node.js video!

Palundrium
Автор

Very simple and easy to follow. Thanks!!!

ezichiebere
Автор

Super helpful for my first docker project, thank you

JustMatt-wx
Автор

This is excellent, thank you so much!!
Im very excited to start messing around with this on my 8gb pi 4 tomorrow! Want to set up a DB to store various monitoring data im collecting on pi zeros (temp, air quality, soil moisture etc) and then think of a way to display the data (probably grafana).
Does this sounding a reasonable solution?
I have subscribed :)

coolcoolsafe
Автор

Hi, thanks so much for the video. do you have a video that I can connect Power BI to MySQL database in a docker container?

euripedescamposjr.
Автор

This is great. I feel like I'm learning from Strong Bad again.

DustinDavis
Автор

Thanks for the video! A newbie here, we don't have to run 'docker pull' command to get the image to local? 'docker run' is enough?

taoismk
Автор

This is a very nice tutorial. Really helped a lot. Could you please tell me how can I use a tool like workbench with docker? I am a newbie and confused at the moment.

digitaluniverse
Автор

how to connect to this database using node-express or php mysqli_connect? Normally if we install mysql on local machine we use host="localhost" in connection string. Is there a way to access the container's MySQL database outside container (outside docker network as well) ?

developer-nasir
Автор

Thank you so much.! Awesome explanation

anikethdeshpande
Автор

the comedy in this video is so underrated, seriously the password part got me laughing like a maniac lmao

johnboldt
Автор

I am curious about one thing that hosting a MySQL in docker container, container images ( it contains a some datas or employee details etc...)might not get affected by stopping and starting the container
How will you do that ??

nehahebbar
Автор

How can I connect host MSSQL from my docker container ?

chiranjit
Автор

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

boyboyguy
Автор

is it ppossible to have a default created database

ryan.aquino