Quick setup of a MySQL server with Docker
Published on 2019-02-12 • Modified on 2019-02-12
This is my first step to learn Docker in 2019 😊. This snippet comes from a Tweet of @pierstoval. I was bluffed as it was indeed really fast to use the produced container. I am now using it to load the dev data fixtures of this blog (they allow to run the unit and fonctionnal tests of the project). All I had to do in my Symfony .env
file is to change the port from 3306
to 13306
. Et voilà! 😉
PS: Of course you don't have to launch the first two lines the first time.
docker stop mysql_host
docker rm mysql_host
docker run --name=mysql_host -dit -e MYSQL_ROOT_PASSWORD=root --publish 13306:3306 mysql:5.7
More on Stackoverflow Random snippet
Call to action
Did you like this post? You can help me back in several ways: (use the "reply" link on the right to comment or to contact me )
- Report any error/typo.
- Report something that could be improved.
- Like and repost!
- Follow me on Bluesky 🦋
- Subscribe to the RSS feed.
- Click on the More on Stackoverflow buttons to make me win "Announcer" badges 🏅.
Thank you for reading! And see you soon on Strangebuzz! 😉