db_cmd

SYNOPSIS

db_cmd.pl {-url <url> | [-reg_conf <reg_conf>] -reg_alias <reg_alias> [-reg_type <reg_type>] } [ -exec <alt_executable> ] [ -prepend <prepend_params> ] [ -sql <sql_command> ] [ -verbose ] [other arguments to append to the command line]

DESCRIPTION

db_cmd.pl is a generic script that connects you interactively to your database using either URL or Registry and optionally runs an SQL command.

OPTIONS

--url <url>

URL defining where eHive database is located

--reg_conf <path>

path to a Registry configuration file

--reg_alias <str>

species/alias name for the eHive DBAdaptor

--executable <name|path>

The executable to run instead of the driver’s default (which is the command-line client)

--prepend <string>

Argument that has to be prepended to the connection details. This option can be repeated

--sql <string>

SQL command to execute

--verbose

Print the command before running it.

--help

Print this help message

All the remaining arguments are passed on to the command to be run. If some of them start with a dash, first use a double-dash to indicate the end of db_cmd.pl’s options and the start of the arguments that have to be passed as is (see the example below with –html)

USAGE EXAMPLES

db_cmd.pl -url "mysql://ensadmin:${ENSADMIN_PSW}@localhost:3306/" -sql 'CREATE DATABASE lg4_long_mult'
db_cmd.pl -url "mysql://ensadmin:${ENSADMIN_PSW}@localhost:3306/lg4_long_mult"
db_cmd.pl -url "mysql://ensadmin:${ENSADMIN_PSW}@localhost:3306/lg4_long_mult" -sql 'SELECT * FROM analysis_base' -- --html
db_cmd.pl -url "mysql://ensadmin:${ENSADMIN_PSW}@localhost/lg4_long_mult" -exec mysqldump -prepend -t analysis_base job

db_cmd.pl -reg_conf ${ENSEMBL_CVS_ROOT_DIR}/ensembl-compara/scripts/pipeline/production_reg_conf.pl -reg_alias compara_master
db_cmd.pl -reg_conf ${ENSEMBL_CVS_ROOT_DIR}/ensembl-compara/scripts/pipeline/production_reg_conf.pl -reg_alias mus_musculus   -reg_type core
db_cmd.pl -reg_conf ${ENSEMBL_CVS_ROOT_DIR}/ensembl-compara/scripts/pipeline/production_reg_conf.pl -reg_alias squirrel       -reg_type core -sql 'SELECT * FROM coord_system'