![]() Here we can see the photo_app database created while running the docker run command. Now let’s have a look at the databases with the following query. In the output, we can also see the user sergey created during the docker run command execution. mysql with the help of the following query. Let’s have a look at the users of the system database i.e. In our case, the password of the root user is set to sergey. Next, you will enter the password which you had set when running the docker run command. In the bash shell, enter the following command to invoke MySQL with the root user. This command creates a new interactive bash shell in the mysql-docker-container through -it that tells Docker to allot a pseudo-TTY connected to the container’s stdin.The docker exec command runs a new command in an already running container.sudo docker exec -it mysql-docker-container bash Next, you will run the docker exec command. Docker Command to Run MySQL Step 3: Docker exec Command With the environment variables, we have changed the root user password, named a database that will be created when the image starts up, created a user that will be granted superuser permissions for the database created, and set the password of that user. ![]() Here MYSQL_ROOT_PASSWORD, MYSQL_DATABASE, MYSQL_USER, and MYSQL_PASSWORD have been set.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |