-
Notifications
You must be signed in to change notification settings - Fork 23
remove_mysql_tables
remove_mysql_tables removes MySQL tables from the database specified with the -d
switch.
Tables to be removed can be specified with the -t
switch and/or tables are removed if they
exactly match the value of given record keys of records in the stream.
See how to setup default MySQL username and password here: http://code.google.com/p/biopieces/wiki/HowTo#Howto_setup_default_MySQL_username_and_password
For more about MySQL: http://www.mysql.com/
remove_mysql_tables [options] <-d <database>> <-t <tables>>
or
... | remove_mysql_tables [options] <-d <database>> <-k <keys>>
[-? | --help] # Print full usage description.
[-d <string> | --database=<string>] # MySQL database.
[-t <list> | --tables=<list>] # Comma separated list of tables.
[-k <list> | --keys=<list>] # Comma separated list of keys.
[-u <string> | --user=<string>] # MySQL user name - Default=<from ~/.biopiecesrc>
[-p <string> | --password=<string>] # MySQL password - Default=<from ~/.biopiecesrc>
[-I <file!> | --stream_in=<file!>] # Read input stream from file - Default=STDIN
[-O <file> | --stream_out=<file>] # Write output stream to file - Default=STDOUT
[-v | --verbose] # Verbose output.
To remove a specific table from a database:
remove_mysql_tables -d dm3 -t mah_RM_new
To assimilate a list of tables to remove do:
read_mysql -d dm3 -q 'show tables' | grab -p test_to_remove | remove_mysql_tables -d dm3 -k Tables_in_dm3 -x
Note that read_mysql with the show tables
query outputs records of the type:
Tables_in_dm3: mah_test_to_remove
---
Thus we know that the -k
value should be Tables_in_dm3
.
Martin Asser Hansen - Copyright (C) - All rights reserved.
November 2008
GNU General Public License version 2
http://www.gnu.org/copyleft/gpl.html
remove_mysql_tables is part of the Biopieces framework.