The Stacks application can use a MySQL database for data processing. If you have a Standard account, and would like to make use of this feature - you can request a database and we’ll get one set up for you.

The Stacks perl scripts will look for a .my.cnf file in your home directory and use that for the mysql settings. That file should contain:


Then when you run either or use the -B flag to set the database name (typically your user name)

The database is empty to start, to set up the tables, run

mysql -u your_user_name -p -h the_db_name < /opt/modules/biology/stacks/1.42/share/stacks/sql/stacks.sql

That script may error out on the first line (which isn’t needed). If so, drop the first line and then run it like this:

tail -n +2 /opt/modules/biology/stacks/1.42/share/stacks/sql/stacks.sql > fixed_stacks.sql
mysql -u your_user_name -p -h the_db_name < fixed_stacks.sql

To clear the database between runs, try:

MYSQL="mysql -h -u your_user_name -pThePassword -D the_db_name"
$MYSQL -BNe "show tables" | awk '{print "set foreign_key_checks=0; drop table `" $1 "`;"}' | $MYSQL
unset MYSQL