Database down via terminal
- Database access intro
- See database export/import intro
- How to connect to the remote database via terminal
# Terminal window 1 ssh -N -L 13306:mysql:3306 {{app-env-id}}@ssh.{{region}}.frbit.app # This has no output. Open a new terminal window next.shell
# Terminal window 2 # 01. Create a dump from the remote database mysqldump --set-gtid-purged=OFF --no-tablespaces -h127.0.0.1 -P13306 -u{{app-env-id}} -p {{app-env-id}} > fortrabbit-backup.sql # 02. Import to your local database mysql -u{{local-db-user}} -p {{local-db-name}} < fortrabbit-backup.sqlshell
# Other development environments
Steps may differ on containerized development environments. It might be required to login to a container or specifically execute a command on the container.
- Docker
docker exec -i {container} …- execute a command
- DDEV
ddev import-db < dump.sql- import a database from hostddev auth- login to the container (first)ddev exec …- execute a command
Found a tpyo?Edit