-
Notifications
You must be signed in to change notification settings - Fork 8
Connect to a MySQL database
Maksym Zaporozhets edited this page Jan 8, 2024
·
3 revisions
Connect to MySQL database with the MySQL client from the given container.
Simple usage:
```shell
php bin/dockerizer docker:mysql:connect -c <container>
Advanced usage with aliases:
# Export a global variable containing the path to your projects root directory
export DOCKERIZER_PROJECTS_ROOT_DIR=${HOME}/misc/apps/
# Alias to run Dockerizer from any directory
alias DOCKERIZER='php -d xdebug.start_with_request=trigger ${DOCKERIZER_PROJECTS_ROOT_DIR}dockerizer_for_php/bin/dockerizer'
# Run `CONNECT -e` to connect to a MySQL server via the MySQL client shipped within a container.
# You should be in the directory containing `docker-compose.yaml` file.
alias CONNECT='DOCKERIZER docker:mysql:connect -c $(DOCKERIZER composition:get-container-name mysql)'
-
-c
(--container
, required): Container name or ID. -
-e
(--exec
, flag): Connect instead of returning a connection string.
Inside a Docker container: MYSQL_USER
/MYSQL_PASSWORD
/MYSQL_DATABASE
or respective MariaDB environment variables.
- docker:mysql:connect
- docker:mysql:export-db
- docker:mysql:import-db
- docker:mysql:upload-to-aws
- docker:mysql:generate-metadata
- docker:mysql:reconstruct-db
- docker:mysql:test-metadata
- magento:setup
- magento:reinstall
- magento:test-module-install
- magento:test-templates
- magento:test-dockerfiles
- MacOS and Docker Desktop support
- Bash aliases
- Install Symfony with Dockerizer
- Running-apps-with-existing-Docker-compositions
- Limitations
- Building MySQL images with DB: how it works
- Configure AWS Lambda
- Gitlab pipeline to build images
- Managing AWS S3 access
- Using AWS credentials with Dockerizer
- Access management cheat-sheet
- FAQ