Monthly Archives: February 2016

Getting the data into mysql db


book1:page 26:


data was not properly loaded, no delimiter specified in the load data infile command when we run.

need to fix this:

First truncate the table, then modify the load data infile command add Fields terminated by “,” in the loading command. Check and see the data load correctly, do the same for Hus_b, pus_a, pus_b;

back to OS to compare the lines in files

table rows are exactly one less than the lines in files for each, yeeeeeeeeeee.

Connecting to MySQL:
Once the RMySQL library is installed create a database connection object.

mydb = dbConnect(MySQL(), user=’user’, password=’password’, dbname=’database_name’, host=’host’)
Listing Tables and Fields:
Now that a connection has been made we list the tables and fields in the database we connected to.


This will return a list of the tables in our connection.

dbListFields(mydb, ‘some_table’)