This provides the full MySQL command-line interface, so you can use all the familiar commands and flags. You can gain an interactive MySQL shell by attaching to the container and running the mysql command. RELATED: How to Install Docker and Docker Compose on Linux Connecting to MySQL You can start MySQL using MYSQL_ROOT_PASSWORD=secure docker-compose up -d. Writing a docker-compose.yml file is more maintainable. The docker run command can quickly become lengthy, especially if you have complex configuration requirements. RELATED: How to Use Docker to Containerize PHP and Apache Docker Compose Check for a line that contains ready for connections. ![]() ![]() You can check if the database is up by running docker logs my-mysql. The MySQL first-run routine will take a few seconds to complete. Here’s how to run MySQL while satisfying these prerequisites: docker run -name my-mysql -e MYSQL_ROOT_PASSWORD=secret -v $HOME/mysql-data:/var/lib/mysql -d mysql:8.0
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |