Skip to content
byron wallace edited this page Jul 2, 2013 · 11 revisions

To clear the db:

(at sql prompt):

drop database abstrackr;

create database abstrackr;

Now, to recreate and empty tables in the db:

websetup.py contains the table definitions. Just invoke:

paster setup-app development.ini

To export database to a .sql file:

mysqldump -u root -p abstrackr > dump.sql (you will be prompted for a password)

To import a database from a .sql file:

mysql -u root -p abstrackr < file.sql // (you'll be prompted for a password)

NOTES

On OS X, you need to use mysqld_safe, ie.,

/usr/local/mysql/bin/mysqld_safe

To activate virtual env on OS X, use

source bin/activate

Alternatively, just run commands from within the bin subdirectory. e.g.,

sudo env/bin/paster serve --reload development.ini

MySql note for myself:

select count() from Labels l left join Citations c on l.study_id=c.citation_id where l.review_id=XXX group by study_id having count()<2;