This repository provides a docker-compose.yml file to quickly set up a MySQL database container with persistent storage and connect it to JetBrains DataGrip or other database clients.
- MySQL 8.0 container.
- Custom user, password, and initial database.
- Exposed on port
3306for easy client access. - Persistent volume to retain data between container restarts.
git clone https://github.com/vongkeo/mysql_docker.git
cd mysql_dockerdocker-compose up -d- Root User: root
- Root Password: root_password
- Database: testdb
- User: testuser
- User Password: testpassword
- Port: 3306
You can modify these values in the docker-compose.yml file as needed.
Steps:
- Open DataGrip and create a new Data Source.
- Select MySQL as the database type.
- Fill in the connection details:
- Host: localhost
- Port: 3306
- User: testuser
- Password: testpassword
- Database: testdb (optional)
- Test the connection. If successful, save the configuration.
docker-compose downdocker-compose up -dThis project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a PR or open an issue.