Setup Local Databases » History » Revision 1
Revision 1/9
| Next »
Amber Herold, 01/29/2010 05:38 PM
Setup Local Databases¶
- Table of contents
- Setup Local Databases
1 Make sure MySQL is installed¶
Follow the instructions in the Leginon install guide.
Also install phpMyAdmin found under "Other Tools" on this page.
Note that phpMyAdmin version 2.11.10 works with older versions of PHP (that we happen to use).
2 Dump tables from cronus4 to a local file¶
This will grab the actual data that we use so you can play with it.
Log into cronus3 so that you can access cronus4.
$ ssh cronus3
Use mysqldump to get any table data that you want as in the example below.
Cronus4 is the host.
We do not lock the tables because we don't have permission to.
"project" is the name of the database and "login" is the name of the Table.
We make up a file name for the data to dump to.
$ mysqldump -h cronus4 -u usr_object --skip-lock-tables project login > ProjectLogin.sql
Exit cronus3 when you are done dumping tables and load the dump files into your database.
If you followed the instructions for setting up MySQL in the Leginon Install guide, you have already created dbemdata and projectdata databases.
If you don't have them, create them first.
mysql -u root projectdata < ProjectLogin.sql
3 Modify Config.php¶
It should look like this:
// --- Set your leginon MySQL database server parameters $DB_HOST = "localhost"; $DB_USER = "usr_object"; $DB_PASS = ""; $DB = "dbemdata"; // --- XML test dataset $XML_DATA = "test/viewerdata.xml"; // --- Project database URL $PROJECT_URL = "project"; $PROJECT_DB_HOST = "localhost"; $PROJECT_DB_USER = "usr_object"; $PROJECT_DB_PASS = ""; $PROJECT_DB = "projectdata";
4 Populate your databases automagically¶
Point your web browser to http://localhost/myamiweb/.
Navigate to the Administration page and then to the ProjectDB page.
Doing this will populate your database with the schema defined in myami/myamiweb/project/defaultprojecttables.xml.
Updated by Amber Herold almost 15 years ago · 1 revisions