Skip to content
Martin Asser Hansen edited this page Oct 2, 2015 · 6 revisions

Biopiece: read_mysql

Description

read_mysql can submit a query to a MySQL database and the results will be converted to Biopiece records where the table column name is used as record key and each table row is converted to one Biopiece record.

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/

Usage

read_mysql [options] <-d <database>> <-q <query>>

Options

[-?          | --help]               #  Print full usage description.
[-d <string> | --database=<string>]  #  MySQL database.
[-q <string> | --query=<string>]     #  MySQL query.
[-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.

Examples

read_mysql -d dm3 -q 'SHOW TABLES'                            #  Retreive table information from database.
read_mysql -d dm3 -q 'SELECT * FROM estOrientInfo'            #  Retreive entire estOreintInfo.
read_mysql -d dm3 -q 'SELECT * FROM table WHERE Score < 100'  #  Retreive selected lines from table.

See also

list_mysql_databases

read_mysql

remove_mysql_tables

write_mysql

Author

Martin Asser Hansen - Copyright (C) - All rights reserved.

mail@maasha.dk

August 2007

License

GNU General Public License version 2

http://www.gnu.org/copyleft/gpl.html

Help

read_mysql is part of the Biopieces framework.

http://www.biopieces.org

Clone this wiki locally