2. Setup MySQL Database - AlkaBenawra/MDMAPR GitHub Wiki
-
Download the EER diagram located in this repository. The EER diagram stands for enhanced entity-relationship diagram which depicts the database layout, including the field names, field classes, and table relationships.
-
In MySQL Workbench, setup a new database connection. Name the connection MDMAPR2.0 and Press 'OK'.

- Enter the MDMAPR2.0 connection and navigate to the top menu. Press 'File' and then from the dropdown menu select 'Open Model'. Select 'MDMAPR_EER_Diagram_02272020.mwb' and press 'Open'.

- Click the 'EER Diagram' to open. When the EER diagram is visible, go to the top menu and click 'Forward Engineering...' under the 'Database' tab.
- In the prompted dialog box, select 'MDMAPR2.0' as the Stored Connection and then press 'Continue'.
- On the 'Set Options for Database to be Created' page, leave all options unchecked and press 'Continue'.
- On the 'Select Object to Forward Engineer' page, select 'Export MySQL Table Objects' and then press 'Continue'.
-
On the 'Review the SQL Script to be Executed' page, press 'Continue'. Once all forward engineering processes have finished press the 'Close' button on the dialog box.
-
Next, navigate back to the main MDMAPR2.0 database connection page. Under the SCHEMAS heading, right click the area and a dropdown menu will appear. Select 'Refresh All' and the new MDMAPR_2.0 database schema will appear.
- Verify that schema contains all 13 data tables.

- For each table in the database, you can either populate the tables directly using the MySQL Workbench interface or you can upload CSV files into each table using the 'Table Data Import Wizard'. However, the tables must be populated in this chronological order: 1) project_Table, 2) geographicRegion_Table, 3) site_Table, 4) station_Table, 5) replicate_Table, 6) extract_Table, 7) pcrChemistry_Table, 8) runInformation_Table, 9) taxonomic_Table, 10) assay_Table, 11) results_Table, 12) standardCurve_Table, and 13) standardCurveResults_Table.

- If you are importing data into a table, after you have imported your data right click any table and select "Refresh All". Then inspect the data table by clicking the spreadsheet icon next to the table name, you should be able to see the newly uploaded data if your import was successful.
Note: The MySQL_Table_Template_Files folder contains the MDMAPR 2.0 MySQL table template files. These files can be used if you wish to enter your data into a CSV format before uploading into the database. It is recommended to enter data in CSV format and then upload these files into the database as it is usually a quicker approach.
-->
-->

Please refer to the MDMAPR MySQL Database Field Descriptions document for more detailed information on how to populate the database fields. This file indicates required columns and field formats.