How to Set Up MySQL Database with Docker

  Рет қаралды 182,834

Database Star

Database Star

Күн бұрын

Docker is a product that allows developers to create containers, which are self-contained areas on their computer for running applications. They can be used for databases, which is great if you can't install it normally (e.g. you use a Mac).
This video shows you how to set up a MySQL database on Docker. It uses an existing MySQL image on the Docker Hub website. You can use many different versions of MySQL, not just the latest version.
You'll learn how to download and install Docker, find the right MySQL image, download the image, run it, and connect to it in MySQL Workbench. You can use any other IDE that works with MySQL if you prefer.
The connection details for this image mentioned in the video are below.
Host: localhost (or 127.0.0.1)
Port: 3306
Username: root
Password: whatever you specify in the "docker run" command
Timestamps:
00:00 In this video
00:05 High-level steps
00:28 Download Docker
01:22 Run Docker
02:07 Create Docker Hub account
02:41 Search for MySQL image on Docker Hub
03:12 Understand the docker run command
04:25 Adjust docker run command
05:28 Open Terminal and login to Docker
06:18 Download image using Docker Run
07:04 Check status using docker ps
07:33 Connect using MySQL Workbench
07:58 Enter connection details
08:54 Run simple query
/// RESOURCES
📝 Get my free SQL Cheat Sheets: www.databasestar.com/get-sql-...
🧭 SQL Roadmap from basics to advanced: www.databasestar.com/sql-road...
✍️ Learn how to design a database: databasestar.mykajabi.com/edd
📧 Contact me here: www.databasestar.com/contact/
📝 Database Design Exercises: bbrumm.gumroad.com/l/hqsxi
📝 SQL Practice Questions: bbrumm.gumroad.com/l/ulekqk
📝 SQL Performance Quick Guide: bbrumm.gumroad.com/l/fcvny
📝 Ultimate SQL How-To Guide: bbrumm.gumroad.com/l/oqggau

Пікірлер: 262
@talios6824
@talios6824 2 жыл бұрын
If every tutorial were as simple as this one, the world would be a better place. :)
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Thanks!
@chriscastle374
@chriscastle374 Жыл бұрын
Seriously...just started a new job with absolutely no experience and they said, just go do this, figure it out..THIS, figured it out and i'm off on my next 'fetch' request two days earlier than they expected me to...
@MichaelDude12345
@MichaelDude12345 2 жыл бұрын
I was trying to learn how to set up a SQL database on my homelab as a beginner for like over a week, and I for the life of me couldn't figure out why it wasn't working. You really saved my butt with this video, thank you!
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Thanks, glad you found this useful!
@brycenasay6051
@brycenasay6051 Жыл бұрын
After spending HOURS trying to get this to work, this video is EXACTLY what I needed. Thank you so much!
@DatabaseStar
@DatabaseStar Жыл бұрын
Glad to hear it helped you get it set up!
@jameskoh3463
@jameskoh3463 Жыл бұрын
This tutorial is very detailed, yet very simple! Thank you!
@DatabaseStar
@DatabaseStar Жыл бұрын
Glad it was helpful!
@manhkhang7732
@manhkhang7732 Жыл бұрын
This tutorial is really helpful and instructive for a beginner like me. Much appreciated of your work!
@DatabaseStar
@DatabaseStar Жыл бұрын
Glad it was helpful!
@kxk2328
@kxk2328 Жыл бұрын
This was great - seriously thank you x 100! love your approach/style.
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks! I’m glad you liked it.
@adjprojetscmc3867
@adjprojetscmc3867 2 жыл бұрын
Amazing! I got it from the first time with you! Thank you so much!
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad it helped!
@kushagrakasliwal3930
@kushagrakasliwal3930 Жыл бұрын
What a tutorial, detailed yet simple plus calming voice
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks! I’m glad you like it!
@srjrcamilo2854
@srjrcamilo2854 2 жыл бұрын
i was looking for this for quite some time the steps to connect to the db were really useful many thanks.
@DatabaseStar
@DatabaseStar 2 жыл бұрын
You're welcome! Glad it helped.
@liamnguyen1748
@liamnguyen1748 Жыл бұрын
Very simple and concise tutorial. Keeps up the good work bro.
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks!
@Schmiddiqt
@Schmiddiqt Жыл бұрын
Really good tutorial. Helped a lot! Thank you
@DatabaseStar
@DatabaseStar Жыл бұрын
Glad it was helpful!
@fatiheneskose4477
@fatiheneskose4477 Жыл бұрын
the best and simplest tutorial about this topic, thanks
@DatabaseStar
@DatabaseStar Жыл бұрын
Glad it was helpful!
@radomircho
@radomircho 2 жыл бұрын
Thank you very much for this video! It was very helpful! :)
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad it was helpful!
@pedroluiz2741
@pedroluiz2741 2 жыл бұрын
Direct to the point, thanks a lot!!
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Thanks, glad you liked it!
@pouriapmd6077
@pouriapmd6077 3 ай бұрын
two years later and still very helpful. thank you sir.
@DatabaseStar
@DatabaseStar 2 ай бұрын
Glad it helped!
@santrolli
@santrolli 2 жыл бұрын
Thank you so much 😊 I appreciate your work! I wouldn’t be able to manage it on my own
@DatabaseStar
@DatabaseStar 2 жыл бұрын
You're welcome, glad you like the video!
@xinmwang3605
@xinmwang3605 Жыл бұрын
@@DatabaseStar but there is no default table like emp .
@uditachakraborty5965
@uditachakraborty5965 2 жыл бұрын
Thank you, This has helped me to succesfully run the docker desktop and creta ea databse in windows.
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad it helped!
@Hifi58
@Hifi58 2 жыл бұрын
Thank you ! You make me love Docker !
@DatabaseStar
@DatabaseStar 2 жыл бұрын
You’re welcome! Yeah it’s a pretty handy tool!
@margarita3873
@margarita3873 2 жыл бұрын
Your video helped a lot! Thank you!
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad to hear it!
@leonardocampan
@leonardocampan Жыл бұрын
This is the best tutorial video I've ever seen :D thank you very much
@DatabaseStar
@DatabaseStar Жыл бұрын
Oh thanks a lot!
@m3xpl4y
@m3xpl4y 2 жыл бұрын
Thank you, this video helped me a lot, saved my day!
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad it helped!
@chriscdrdev
@chriscdrdev 2 жыл бұрын
This is amazing brother, thank you so much
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad it was helpful!
@KAU50000
@KAU50000 Жыл бұрын
Great tutorial, works at the first time.
@DatabaseStar
@DatabaseStar Жыл бұрын
Great to hear!
@ikahdesign
@ikahdesign Жыл бұрын
Thank you so much for this tutorial. It's very important and useful.
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks, I’m glad you like it!
@ronmalachi9960
@ronmalachi9960 2 жыл бұрын
Good job, nice and useful video !! Thanks
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad it was helpful!
@peterkornos8749
@peterkornos8749 Жыл бұрын
Thank you, nice, clean and helpful.
@DatabaseStar
@DatabaseStar Жыл бұрын
Glad you like it!
@jessebatstone7853
@jessebatstone7853 4 ай бұрын
perfect thank you! was missing the port exposure tags.
@DatabaseStar
@DatabaseStar 4 ай бұрын
Glad it helped!
@hellocodeur
@hellocodeur 2 жыл бұрын
thank you. it work for me without an error
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Happy to hear it!
@antonleshchuk5908
@antonleshchuk5908 2 жыл бұрын
Very succinct and clear. Thx
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Thanks!
@Supernyv
@Supernyv 23 күн бұрын
Nice! Thank you very much @Database Star.
@DatabaseStar
@DatabaseStar 22 күн бұрын
You're welcome!
@user-yu9ky6xh9n
@user-yu9ky6xh9n 9 ай бұрын
This tutorial is really helpful and instructive for a beginner like me. Much appreciated of your work! Could you please explain how setup cluster for same
@DatabaseStar
@DatabaseStar 9 ай бұрын
Thanks, glad it was helpful! I'm not sure how to set up a cluster unfortunately.
@giraldiego
@giraldiego 8 ай бұрын
Thank you, it worked as you explained
@DatabaseStar
@DatabaseStar 8 ай бұрын
Glad it helped!
@poorpanda9033
@poorpanda9033 6 ай бұрын
Damn, Thanks a lot what a clean tutorial !
@DatabaseStar
@DatabaseStar 6 ай бұрын
Thanks!
@joao71gaming
@joao71gaming 2 жыл бұрын
Awesome ! Thank you so much !
@DatabaseStar
@DatabaseStar 2 жыл бұрын
No problem!
@jorgeduran6400
@jorgeduran6400 Жыл бұрын
good work! all in this video works fine!
@DatabaseStar
@DatabaseStar Жыл бұрын
Good to hear!
@the_pachu4953
@the_pachu4953 2 жыл бұрын
thanks so much! keeep going making greant content!
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Thanks!
@ahmedabuqamar1517
@ahmedabuqamar1517 2 жыл бұрын
Thank you, it's nice video Keep on
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Thanks!
@Devman483
@Devman483 Жыл бұрын
thank you easy and simple
@DatabaseStar
@DatabaseStar Жыл бұрын
You’re welcome!
@nicetomeetugaming7024
@nicetomeetugaming7024 2 жыл бұрын
Amazing video sir!
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Thanks, glad you like it!
@moj_kokot
@moj_kokot 2 жыл бұрын
Thank you so much !
@DatabaseStar
@DatabaseStar 2 жыл бұрын
You're welcome!
@vikasts1063
@vikasts1063 Жыл бұрын
great tutorial thanks
@DatabaseStar
@DatabaseStar Жыл бұрын
You're welcome!
@Cashandrick
@Cashandrick 2 жыл бұрын
Thank you so much ! :)
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad you like it!
@alijenab9131
@alijenab9131 2 жыл бұрын
thanks it was useful.
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad it was helpful!
@ihorslavinskyi9823
@ihorslavinskyi9823 6 ай бұрын
the best tutorial ever
@DatabaseStar
@DatabaseStar 6 ай бұрын
Thanks!
@petergnadig4865
@petergnadig4865 Жыл бұрын
thanks for this tutorial
@DatabaseStar
@DatabaseStar Жыл бұрын
You're welcome!
@KhuongNguyen-vm5kc
@KhuongNguyen-vm5kc Жыл бұрын
holy shiet this channel is GOLD
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks!
@GabrielFerreira-sx8yc
@GabrielFerreira-sx8yc Жыл бұрын
thank you helped me 🤙
@DatabaseStar
@DatabaseStar Жыл бұрын
No problem!
@RogerHolden
@RogerHolden 7 ай бұрын
Great overview on how to do with Docker, but I'm not sure why anyone would want to do it this long-winded and complex way. On Linux you can install mySQL with a single line on the terminal and for Mac and Windows you can use MAMP or XAMPP which can be set up with a few simple clicks and have a GUI for easy management. I'm guessing Docker could allow different configurations?
@DatabaseStar
@DatabaseStar 7 ай бұрын
Thanks! Yeah MAMP and XAMPP are pretty easy to set up, but perhaps people don't need Apache or PHP that's included in those. Docker can be used for quick setups for development, and is often used during the deployment process, perhaps for using as a database on a test environment. I don't have a lot of experience with Docker but there are probably more advantages too.
@Ore-rf1jq
@Ore-rf1jq Жыл бұрын
thank you for your help
@DatabaseStar
@DatabaseStar Жыл бұрын
You're welcome!
@mdony722
@mdony722 Жыл бұрын
just like coldfusion TV , thank you
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks!
@bootifulghost8624
@bootifulghost8624 2 жыл бұрын
Thanks very much for the video. Do you think it's possible and a smart idea to expose a DB through NGINX Proxy Manager? Is that even possible, so external applications can access the MySQL DB?
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Good question. I’m not familiar with NGINX Proxy Manager so can’t really advise on that 😕
@bootifulghost8624
@bootifulghost8624 2 жыл бұрын
@@DatabaseStar Thanks for the fast reply. How would I connect to the DB through the same network but from another computer?
@MichaelDude12345
@MichaelDude12345 2 жыл бұрын
@@bootifulghost8624 when you set up the database I'm sure you had to assign a port as well as find the ip address used by the host device (or if containerized then the Ip address of the container or vm). Go to mysql workbench (or whatever SQL associated software you want to use) on the computer on the same nextwork and type in the ip address followed by a colon and then the port you assigned under connections. That will let you access it from that computer. You can do that with any software that works with SQL and just put in that info, i have been using java so for me that means i provided that info to jdbc. It'll also ask for the username and the password you set up. Does that make sense? Hope that helped.
@bootifulghost8624
@bootifulghost8624 2 жыл бұрын
@@MichaelDude12345 Thanks for the reply, I already got it to work, even externally. Thanks nonetheless for your reply :)
@GBOfficialVlog
@GBOfficialVlog 9 ай бұрын
Thank you!
@DatabaseStar
@DatabaseStar 9 ай бұрын
You're welcome!
@DanKardell
@DanKardell 2 жыл бұрын
Great job! How do you connect via the commandline to the db?
@DatabaseStar
@DatabaseStar 2 жыл бұрын
There is a command to do this that I've seen in some examples, but I haven't used it. I'll look at it and find out.
@DanKardell
@DanKardell 2 жыл бұрын
@@DatabaseStar so I found that after creating the container that I could use "docker exec -it some-mysql bash" to get to a prompt and then use the "mysql" commands just like I had MySQL installed locally. Pretty cool! Thanks!
@hibamakhloufi6900
@hibamakhloufi6900 2 жыл бұрын
you saved my life
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad it was helpful!
@parambharti7095
@parambharti7095 2 жыл бұрын
Thanks a lot.
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Glad to help
@agusmahari2755
@agusmahari2755 Жыл бұрын
thanks
@DatabaseStar
@DatabaseStar Жыл бұрын
No problem!
@d_sportello
@d_sportello 2 жыл бұрын
Thank you
@DatabaseStar
@DatabaseStar 2 жыл бұрын
You’re welcome!
@aaomms7986
@aaomms7986 2 жыл бұрын
thx uuu . i've question if i've mysql server on my PC i still can use docker port 3306 same port with mymsql server?
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Yes, as long as they are not both running at the same time, it should be OK. I have the same situation: mysql installed locally as well as Docker.
@aaomms7986
@aaomms7986 2 жыл бұрын
@@DatabaseStar thxxxx
@ilyasbakhtiar5465
@ilyasbakhtiar5465 2 жыл бұрын
thank you
@DatabaseStar
@DatabaseStar 2 жыл бұрын
No problem!
@westcoastwarriorsarchive7929
@westcoastwarriorsarchive7929 Жыл бұрын
for me the whole video was helpful, im currently trying to learn how to use corteza and was trying to figure out how to connect a database, turns out you connect to docker and it kind of just connects on its own somehow.
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks, good to know the video was helpful and you got it working.
@skh551
@skh551 11 ай бұрын
So couple of things I noticed, --name indicates the name of the container, not the image. So we can refer to the container by "some-mysql". "-p" is short for publish that represents mapping between the ports in local machine and containers, it does not mean just ports.
@DatabaseStar
@DatabaseStar 11 ай бұрын
Thanks for the information, that's good to know!
@ganeshkamble9078
@ganeshkamble9078 9 ай бұрын
This is Awesome !!
@DatabaseStar
@DatabaseStar 9 ай бұрын
Thanks!
@lalik777
@lalik777 2 жыл бұрын
Thank , if i want container running on a specific host , for example 192.168.64.2 instead of localhost , how can we do it ?
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Hmm I’m not sure how to do that unfortunately!
@vpms6054
@vpms6054 24 күн бұрын
which version of workbench you have used... because my workbench version is 8.0.34 and its says that it may not work properly Good explanation by the way
@DatabaseStar
@DatabaseStar 22 күн бұрын
Oh what error are you getting, and where is it being shown? I'm using 8.0.21.
@dmt7992
@dmt7992 2 жыл бұрын
everything workng ur chad-boi
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Thanks!
@zidrexandag9664
@zidrexandag9664 Жыл бұрын
what if you put data on the container and I stopped the container, if you run docker run again, will my data be retained? or can i just use docker start ?
@DatabaseStar
@DatabaseStar Жыл бұрын
I think the data is kept if you stop and restart the container, but I'm not 100% sure on that. When I've used docker for my databases, the data is kept when I stop it. But I don't know when it is removed.
@swapnilkumar591
@swapnilkumar591 2 жыл бұрын
latest: Pulling from library/mysql docker: no matching manifest for linux/arm64/v8 in the manifest list entries. See 'docker run --help'. getting this error
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Hmm I'm not sure what that error means unfortunately.
@milon27
@milon27 Жыл бұрын
i have created a database in digital ocean managed database service now when i use prisma to connect with it locally it works fine. but when i dovkerized the node js app then prisma saying not able to reach the database host p1001 error, db connection error. any idea how to fix it? i tried without prisma just mysql2 and it works in dockerized app.
@DatabaseStar
@DatabaseStar Жыл бұрын
It sounds like there could be a connection issue with prisma in the docker container. But I don't know anything about prisma or putting NodeJS apps inside Docker.
@milon27
@milon27 Жыл бұрын
@@DatabaseStar fixed it by updating prisma to latest version
@himanshupandey3451
@himanshupandey3451 Жыл бұрын
thanks. and how i connect this databas through powershell or command line of my local window machine?
@DatabaseStar
@DatabaseStar Жыл бұрын
You're welcome! I think you can open a command line and run the "mysql" command. You'll need to specify the username and hostname. So something like this: mysql -u root -p -h localhost
@heroman2937
@heroman2937 Жыл бұрын
When i test the connection, i get an error message "Access denied for user 'root'@'localhost' (using password: YES)" . Any idea what might be causing that ? The container was made just fine and is running.
@DatabaseStar
@DatabaseStar Жыл бұрын
That's strange. I assume the password you have entered is correct? If so, then there may be another MySQL instance running on your computer. If there isn't, then you could try changing the password, which is one of the steps I've written here: www.databasestar.com/access-denied-for-user-root-at-localhost/ If that doesn't work, then I'm not sure what could be the issue.
@ericksantos12
@ericksantos12 8 ай бұрын
Hello! really nice tutorial thank you! I've one question, i've heard that docker containers are immutable and once they are killed all the data inside is gone forever, my question is if i kill mysql container all the data will be deleted? if yes there's a way to save to the host machine?
@DatabaseStar
@DatabaseStar 8 ай бұрын
Yes, the data in a database within Docker is not guaranteed to be kept if the image is stopped. This is why Docker is recommended for dev and test but not for prod (I believe). I do have a video on my channel about using binding and mounting a volume for Docker which can help.
@ericksantos12
@ericksantos12 8 ай бұрын
@@DatabaseStar tysm
@paladin9876
@paladin9876 2 ай бұрын
@@DatabaseStar Docker is completely fine for Production environments. Why would you create a docker container for development and then not have that same environment in production? That's one of the main advantages of using Docker.
@vensonestrope4534
@vensonestrope4534 6 ай бұрын
I did but I changed the port to 3307. How can I get the DB_Hostname cause I need to connect it to my laravel app. Hope you can help. Thank you.
@DatabaseStar
@DatabaseStar 6 ай бұрын
I think it should be localhost, that's what I use when I connect to the database when it runs in Docker.
@tonycavanagh1929
@tonycavanagh1929 Жыл бұрын
Do you need to have MySQL installed on your PC to get MySQL workbench working. I just want to use MySQL in docker.
@DatabaseStar
@DatabaseStar Жыл бұрын
No, you don’t need to have it installed on your Pc. If you use this Docker process then MySQL is included in the Docker container.
@tonycavanagh1929
@tonycavanagh1929 Жыл бұрын
@@DatabaseStar Thanks will try and install MySQL workbench again.
@decemberflower20
@decemberflower20 2 жыл бұрын
Let me ask how can we configure mysql docker container to be able to connect from host machine?
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Good question - I’m not sure actually!
@tarikb.2201
@tarikb.2201 Жыл бұрын
Just two remarks. Why setting up a docker account to pull the image from docker hub? This is not necessary. Second one what about persistence? If you create tables etc, and fill them all the work is gone as soon as you stop the container. Why not adding a simple -v to the docker run command to set up a db file on the host?
@DatabaseStar
@DatabaseStar Жыл бұрын
Good points! I set up a docker account as I was getting errors when pulling the images and my research found that I needed to set up an account. But this may not have been correct or may have changed. So it's good to see an account is not needed. Persistance is also a good point. Yes the contents will be lost if you reset the container. I do have another video on setting up a volume and how that works.
@aqkhana2002
@aqkhana2002 2 жыл бұрын
i was unable to connect with workbench , and i have to add user with I.P address to allow to access, why do i need i.p address ?
@DatabaseStar
@DatabaseStar 2 жыл бұрын
What error message were you getting with MySQL Workbench? It seems strange you need to add the IP address.
@ninja_ape
@ninja_ape Жыл бұрын
Nice one
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks!
@MelodySongsPlace
@MelodySongsPlace 11 ай бұрын
Not able to connect to MySQL using docker credentials,how can I see database in my local MySQL's db?
@DatabaseStar
@DatabaseStar 11 ай бұрын
What issue are you having when connecting to MySQL?
@zj1281
@zj1281 Жыл бұрын
Hi, can i check how do other users connect to this database and how do i access this database and update it using RStudio?
@DatabaseStar
@DatabaseStar Жыл бұрын
Oh I’ve never used RStudio before so I’m not sure how to connect with it. Hopefully others can respond and provide assistance.
@vffncl0
@vffncl0 2 жыл бұрын
Any idea how to resource optimize this container?
@DatabaseStar
@DatabaseStar 2 жыл бұрын
I’m not sure what that is unfortunately
@TheInternetFan
@TheInternetFan Жыл бұрын
hi there, how would I modify this if I wanted to use VS Code instead of Workbench?
@DatabaseStar
@DatabaseStar Жыл бұрын
The part that would change is connecting to the database. I have another video on vscode with sql, which involves installing an extension in vscode and connecting to the MySQL database
@TheInternetFan
@TheInternetFan Жыл бұрын
@@DatabaseStar , will look it up then, thanks for your reply ;-)
@okorochavivian7153
@okorochavivian7153 2 жыл бұрын
Mine is saying failed to connect to MySQL at 127.0.1:3306 with user root., is there any other way to correct the error?
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Hmm I would guess the password is incorrect or the Docker container is not running. I’m not sure what else it could be but I think it’s a common issue.
@zuberpalekar
@zuberpalekar Жыл бұрын
@@DatabaseStar - This happens because the password set contains some special characters. For example, when I set the password as Pa$$w0rd it gives this error. I think the $ is perceived as some special character in the docker run command. I have had similar issue when running other containers when using the password with $ in it
@srinathchintha9565
@srinathchintha9565 Жыл бұрын
@Database Star , Databa For me it's working with terminal but not working with Java code and DBeaver. getting Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. Connection refused (Connection refused) Please help.
@SurendiranRaja
@SurendiranRaja Жыл бұрын
How to create Dockerfile for mysql server hosting is possible?
@DatabaseStar
@DatabaseStar Жыл бұрын
I’m not sure how to create a Docker file unfortunately
@viacheslavm5138
@viacheslavm5138 Жыл бұрын
very good
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks!
@sushmagowda9054
@sushmagowda9054 2 жыл бұрын
Please help me fix this error. no matching manifest for linux/arm64/v8 in the manifest list entries.
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Hmm I've never seen that error before. What operating system are you running?
@sushmashekar7796
@sushmashekar7796 2 жыл бұрын
@@DatabaseStar On MACOS (m1 chip)
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Hm perhaps there's an issue with Docker on the new M1 chips? Has a Google search showed anything for this error?
@krishnasagar9492
@krishnasagar9492 Жыл бұрын
my mysql workbench is running 3307 port what should i do ,when i am entering 3306 port it is showing password denied error please help
@DatabaseStar
@DatabaseStar Жыл бұрын
If your MySQL is on port 3307 you should be able to specify this port in Workbench and connect to it.
@christopherjspiteri
@christopherjspiteri Жыл бұрын
When I run SELECT NOW() it shuts off the Mysql Workbench. I am using Docker on a Mac.
@DatabaseStar
@DatabaseStar Жыл бұрын
That's odd. Does it crash for any other commands or queries you run?
@harryvideo
@harryvideo 2 жыл бұрын
I tried to do this and got the message localhost not found. I tried both the IP as well as the word localhost.
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Oh that’s interesting. Is the Docker container running? As in does it say running when you run “docker ps”?
@law6906
@law6906 7 ай бұрын
Does this mean if the container dies or is stopped then the data is lost?
@DatabaseStar
@DatabaseStar 7 ай бұрын
Yes, I believe so, which is why it's not recommended to use Docker in production or any database where you want to keep the data.
@fatihachaibi2920
@fatihachaibi2920 Жыл бұрын
hi thanks for this tutorial but when I test the connection it's failed why ??
@DatabaseStar
@DatabaseStar Жыл бұрын
What error message are you getting?
@rivertorres562
@rivertorres562 Жыл бұрын
Where is my image?, i need the dockerfile to upload to my github and i don't know where it is, please help
@DatabaseStar
@DatabaseStar Жыл бұрын
I'm not sure where the image is stored actually. Hopefully the Docker documentation or a Google search could help.
@WisdomIsAwesome
@WisdomIsAwesome 2 жыл бұрын
I did the same process but I got this error when connecting with Mysql workbench: docker lost connection to mysql server at 'reading initial communication packet', system error: 0 Pls help!
@DatabaseStar
@DatabaseStar 2 жыл бұрын
I haven't seen that one before, not sure what it could be unfortunately! The only thing I can think of is to try and wait 10-20 seconds for the container to start.
@WisdomIsAwesome
@WisdomIsAwesome 2 жыл бұрын
@@DatabaseStar I got the problem! I was using the "-p 3308:3308" ports mapping instead of "-p 3308:3306" ports mapping. So, it didn't get bound to to correct mysql port internally.
@mr.pledplool272
@mr.pledplool272 2 жыл бұрын
@@DatabaseStar I also had this problem. To clarify where this originates from: some MySQL server versions have the default host ip for the root user set to the localhost, meaning in case the of a dockerized MySQL server the Docker-internal localhost (try: "SELECT user, host FROM mysql.user;" from within the bash terminal of the container to see what I mean). Trying to access the MySQL Server from the normal host then yields the error that @Shashwat Khare pointed out. To circumvent simply change the root host ip to "%" (=any ip) ("UPDATE mysql.user SET host = '%' WHERE user = 'root';" also via the bash terminal of the container). Thanks for the vid btw. Great work!
@kumarguru3044
@kumarguru3044 Жыл бұрын
But people say a database as a container is a bad idea for prod environments. If so can you give me a good explanation?
@DatabaseStar
@DatabaseStar Жыл бұрын
Yeah that's right, I've heard that too. I think it's because of the volatility of the data storage. There's a risk that a Docker container can be stopped and restarted, which may cause the data to be removed. From my basic knowledge, Docker is great for developing and testing databases but not advised for production.
@gautamnaik2516
@gautamnaik2516 2 жыл бұрын
Can we follow same steps in linux machine
@DatabaseStar
@DatabaseStar 2 жыл бұрын
I think so, but I've never tried it.
@aimanothman6887
@aimanothman6887 Жыл бұрын
goodjob bros
@DatabaseStar
@DatabaseStar Жыл бұрын
Thanks!
@mosesodalo5074
@mosesodalo5074 2 жыл бұрын
It worked, but when i want to connect with a php app its says mbind: Operation not permitted.
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Hmm I’m not sure what that issue could be unfortunately
@patrykK1028
@patrykK1028 Жыл бұрын
docker login doesn't ask me for credentials and instead says "Authenticating with existing credentials..." which doesn't do anything and it locks the command line so I can't write anything after that
@DatabaseStar
@DatabaseStar Жыл бұрын
That's strange. Is there a way to log out from Docker on the command line and try the process again?
@patrykK1028
@patrykK1028 Жыл бұрын
@@DatabaseStar I restarted my PC and then it asked me for credentials and worked
@user-nz3sg8mx7f
@user-nz3sg8mx7f 2 жыл бұрын
Dont working!! I try to use -p 3307:3306, because there is local mysql server. And connection can not be created
@DatabaseStar
@DatabaseStar 2 жыл бұрын
Oh, do you get an error message at all? What if you stop your local MySQL server?
@user-lm9ve2js2t
@user-lm9ve2js2t Жыл бұрын
damn it I was following the tutorial, but I got problem and is stuck on it long time. I couldnt connect work bench to the thing
@DatabaseStar
@DatabaseStar Жыл бұрын
Oh, what error message are you getting?
@user-lm9ve2js2t
@user-lm9ve2js2t Жыл бұрын
@@DatabaseStar oh hi! Sorry seems like I just fixed it. Instead of 3306:3306, I did 3307:3306 and the workbench connect to 3307 and it worked
@HaiTran-gx2fz
@HaiTran-gx2fz 2 жыл бұрын
my listen English is not good, so i don't understand at 8:14, i don't, where is my password. My SQL Workbench appear error. You can explain for me, where is my password at comand line "docker run" . Comman line "docker run", i write like you
@DatabaseStar
@DatabaseStar 2 жыл бұрын
No problem! This is the password in the command shown at about 6:36. The part of the command that comes after MYSQL_ROOT_PASSWORD. In the video, this is my-secret-pw. So if you did the same as the video, you can enter my-secret-pw as the password.
@HaiTran-gx2fz
@HaiTran-gx2fz 2 жыл бұрын
@@DatabaseStar thank you so much😘😘
How to Set Up MySQL Database with Docker
16:46
Abstract programmer
Рет қаралды 37 М.
How to Save Docker Data using Bind Mounts or Volumes
13:41
Database Star
Рет қаралды 28 М.
Backstage 🤫 tutorial #elsarca #tiktok
00:13
Elsa Arca
Рет қаралды 41 МЛН
Как быстро замутить ЭлектроСамокат
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 14 МЛН
Hot Ball ASMR #asmr #asmrsounds #satisfying #relaxing #satisfyingvideo
00:19
Oddly Satisfying
Рет қаралды 46 МЛН
How to Set Up SQL Server Database with Docker
9:39
Database Star
Рет қаралды 78 М.
Warframe | Eternal Ammunition | Athodai
8:16
MCGamerCZ
Рет қаралды 10 М.
Spinning MySQL Database with Docker
9:38
Hussein Nasser
Рет қаралды 50 М.
How to Set Up a PostgreSQL Database with Docker
10:01
Database Star
Рет қаралды 160 М.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Dreams of Code
Рет қаралды 174 М.
Stop Doing This With Your SQL
5:50
Database Star
Рет қаралды 2,3 М.
Docker Volumes explained in 6 minutes
6:03
TechWorld with Nana
Рет қаралды 266 М.
Девушка и AirPods Max 😳
0:59
ОТЛИЧНИКИ
Рет қаралды 16 М.
How charged your battery?
0:14
V.A. show / Магика
Рет қаралды 6 МЛН
Gizli Apple Watch Özelliği😱
0:14
Safak Novruz
Рет қаралды 1,5 МЛН
Как работает автопилот на Lixiang L9 Max
0:34
Семен Ефимов
Рет қаралды 15 М.
APPLE совершила РЕВОЛЮЦИЮ!
0:39
ÉЖИ АКСЁНОВ
Рет қаралды 1,6 МЛН
WWDC 2024 - June 10 | Apple
1:43:37
Apple
Рет қаралды 10 МЛН