CSV into MySQL

At this point I am just gathering requirements and brainstorming about how to handle this project.  Is it something that should be done in code.  Is there an application out there that already does what I want that someone thinks I should use, etc...

So I would like to pick your brains.

We have a manual process were someone goes through 2 CSV files and manually manipulates data.  I want to put that data into a MySQL database and automate some of that manipulation for her.

The CSV files are uploaded to our server on a weekly basis by a 3rd party.
We have a Redhat Enterprise Linux 6 server with MySQL version 5.1.71, Webmin 1.660.

What would be the best process to create the MySQL database table and then create an automated process to import the data from the 2 CSV files (that have the same structure) into the database.  And then repeat the import once a week (roughly 6am on Mondays).

Does this make sense?

Is this best handled in code?
If so can you point me at some examples for best practices?

Or is there some sort of GUI that I can put on my server to schedule this for me?

Thanks in advance for your expertise.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kevin CrossChief Technology OfficerCommented:
MySQL has LOAD DATA INFILE statement that could help.
REFMAN: http://dev.mysql.com/doc/refman/5.1/en/load-data.html

MySQL also has the mysqlimport program.
REFMAN: http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html

Kedar explains here:

You can handle the scheduling (automation) of executing either import method via cron job, or other tools on the Linux server.  In addition, newer versions of MySQL have scheduled events.
REFMAN: http://dev.mysql.com/doc/refman/5.1/en/create-event.html

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Razzmataz73Author Commented:
Thank you Kevin.

If I have questions on this should I post it here?
Or after I make a decision on which way to go would it be better to start a new thread?
Kevin CrossChief Technology OfficerCommented:
What is the question?  If it helps you pick the solution, I say post it here as it may help others decide between the options as well.  If once you pick a solution, you have other questions a new thread is helpful as it allows us to focus on that issue independently as well as allows other Experts to chime in (as it will gain more attention as a new question).
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

Razzmataz73Author Commented:

I have my MySQL Dabases created on my server.  And our files are being uploaded on a weekly basis to the same server into a web folder location:

In particular it overwrites the files:

I am starting to go through your docs now, but if you could help me with getting the automation to work that would be perfect.

The MySQL Database is called
and the table is called

And the fields are:

rate_basecode                       Matches up to column A of the CSV
rate_yacht                              Matches up to column B of the CSV
rate_crewed                           Matches up to column C of the CSV
rate_date                                Matches up to column D of the CSV
rate_charter_date                   Matches up to column E of the CSV
rate_dollars                            Matches up to column F of the CSV
rate_cents                              Matches up to column G of the CSV      
rate_currency                         Matches up to column H of the CSV
Razzmataz73Author Commented:
I got this to work:

LOAD DATA INFILE '/var/www/sailing-vacations.mobi/tuimarine/BROKERUSDSS.CSV' INTO TABLE rates FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' ;

LOAD DATA INFILE '/var/www/sailing-vacations.mobi/tuimarine/BROKERUSD.CSV' INTO TABLE rates FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' ;

Now I just need to figure out how to automate that.
Kevin CrossChief Technology OfficerCommented:
I would do that via scheduled task (cron tab) of server.  I am not a Linux person, so a new question may be helpful for that piece.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.