课程: Databases for Node.js Developers (2021)

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Set up MySQL

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…

内容