An official website of the United States government.

We've made some changes to EPA.gov. If the information you are looking for is not here, you may be able to find it on the EPA Web Archive or the January 19, 2017 Web Snapshot.

Exploring ToxCast Data: How to Set Up R and MySQL

The following links exit the site ExitIt is helpful to have a working knowledge of R and MySQL to use the ToxCast tcpl R package. For further details as to how to use R and MySQL, please reference these instructions and external resources.

Setting up R

  1. Download the latest version of the R package from the CRAN according to your operating system (Linux, Mac, Windows).
    1. Review the FAQs and instructions for installing R for the first time (Windows) (Mac) (Linux).

Setting up MySQL

  1. Download the latest version of the MySQL community server
    1. Select the appropriate installer for your operating system
      1. Windows: MSI installer
      2. MAC: DMG installer
    2. The installer will walk you through the installation
    3. During the installation, be sure to copy the temporary root password. You will need it later.
    4. For Windows, MySQL should automatically be added to your PATH.
    5. For MAC, if MySQL was not added to your path automatically then add it manually
      1. Open terminal and type:

        echo 'export PATH=/usr/local/mysql/bin:$PATH' >>
        ~/.bash_profile
        </>

         
  2. Open the command line (Windows) or terminal (MAC) to login to the MySQL server with the command:

    mysql -u root –p
    </>

     
  3. Enter the temporary root password when prompted for a password.
  4. Change the root password
    1. Full documentation can be found at MySQL Website
  5. Create the database, select it as the default database, and load the dump file:

    mysql> CREATE DATABASE IF NOT EXISTS invitrodb_v2;
    mysql> USE invitrodb_v2;
    mysql> source prod_external_invitrodb_v2.all.sql
    </>

     
    1. Further documentation can be found at MySQL Website
    2. Be patient; this can take anywhere from 3 to 8 hours.

Links