O'Reilly logo

Clean Data by Megan Squire

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Step three – import the data into MySQL in a single table

To load our somewhat cleaner data file into MySQL, we will need to revisit the CSV-to-SQL techniques from the Importing spreadsheet data into MySQL section in Chapter 3, Workhorses of Clean Data – Spreadsheets and Text Editors:

  1. From the command line, navigate to the directory where you have saved the file you created in step two. This is the file we are going to import into MySQL.
  2. Then, launch your MySQL client, and connect to your database server:
    user@machine:~/sentiment140$ mysql -hlocalhost -umsquire -p
    Enter password:
  3. Enter your password, and after you are logged in, create a database within MySQL to hold the table, as follows:
    mysql> CREATE DATABASE sentiment140; mysql> USE sentiment140; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required