From the course: Databases for Node.js Developers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Set up MySQL

Set up MySQL

From the course: Databases for Node.js Developers

Start my 1-month free trial

Set up MySQL

- [Presenter] As for MongoDB and Redis, we will now also create a container for MySQL for that first run Docker, "pull mysql". Also, make sure again, that your docker daemon is running, and this will pull down the latest version of the MySQL image. Next, as we did before, I do a "docker run --name". The name is "mysql", and I'm also do the port mapping, so, mapping my local port 3406 to the container port 3306, which is the default port of MySQL, and here also add one environment variable with "-e". This environment variable is all uppercase, "MYSQL_ROOT_PASSWORD" So, this will be set as the password for the root user, and I simply use my password here, needless to say that in production you want to have a way more safe password. And then in the end I also use "-d" to create daemon, and I also have to tell which image to use. It's the "mysql" image that we just pulled, and then I can hit Return. Now we have a…

Contents