rcstack cli db

CLI with Database connection

Usage

rcstack cli db [OPTIONS]

Examples

# run the database CLI, postgres or mysql prompt based on DB_TYPE in .runtime.env
- ./rcstack cli db

# run the database command without interactive prompt
echo "select 1" | ./rcstack cli db --no-tty

# restore backup for postgres
# copy the backup sql file, and execute cli db to run the backup restore
1) cp your_sql_backup.sql .custom/db_dump/your_sql_backup.sql
2) ./rcstack cli db
3) \i /var/rc-data-dump/your_sql_backup.sql

# restore backup for mysql
# copy the backup sql file, and execute cli db to run the backup restore
1) cp your_sql_backup.sql .custom/db_dump/your_sql_backup.sql
2) ./rcstack cli db
3) use rhodecode
4) source /var/rc-data-dump/your_sql_backup.sql

Options

–no-tty

when running docker command don’t attach to TTY. Useful for running a script out of shell context, e.g crontab

–user

User to run the command as, e.g root / rhodecode

–env-file-path ENV_FILE_PATH

Set custom env file

Attributes

 

Default Value:

$PWD/.custom/.runtime.env

–mysql-root

Use privileged user for operations such as change of passwords, or user management for mysql