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:
- 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.
- Then, launch your MySQL client, and connect to your database server:
user@machine:~/sentiment140$ mysql -hlocalhost -umsquire -p
- 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; ...