# I'm trying to write a script that uses FasterCSV.table and puts the result in a MySQL database

**URL:** <https://www.ruby-forum.com/t/im-trying-to-write-a-script-that-uses-fastercsv-table-and-puts-the-result-in-a-mysql-database/133623>\
**Category:** Ruby\
**Created:** [April 2, 2008, 3:31am UTC](https://www.ruby-forum.com/t/im-trying-to-write-a-script-that-uses-fastercsv-table-and-puts-the-result-in-a-mysql-database/133623 "2008-04-02T03:31:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronald\_Steckly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Ronald\_Steckly](https://www.ruby-forum.com/u/Ronald_Steckly)\
**Post date:** [April 2, 2008, 3:31am UTC](https://www.ruby-forum.com/t/im-trying-to-write-a-script-that-uses-fastercsv-table-and-puts-the-result-in-a-mysql-database/133623/1 "2008-04-02T03:31:32Z")

</div>

Trouble is, I know how to do the CSV part. But I don’t know how to do  
the  
MySQL part. How do I connect to a MySQL database? I mean, it seems  
intuitive on Rails with ActiveRecord, but in a script?

Any ideas?

Ron

---

<div class="post-metadata">

**Author:** ![Ronald\_Steckly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@Ronald\_Steckly](https://www.ruby-forum.com/u/Ronald_Steckly)\
**Post date:** [April 2, 2008, 5:15am UTC](https://www.ruby-forum.com/t/im-trying-to-write-a-script-that-uses-fastercsv-table-and-puts-the-result-in-a-mysql-database/133623/2 "2008-04-02T05:15:07Z")

</div>

On Apr 1, 2008, at 8:30 PM, Ronald Steckly wrote:

> Trouble is, I know how to do the CSV part. But I don’t know how to  
> do the  
> MySQL part. How do I connect to a MySQL database? I mean, it seems  
> intuitive on Rails with ActiveRecord, but in a script?

You can use ActiveRecord without Rails:

[http://wiki.rubyonrails.org/rails/pages/HowToUseActiveRecordOutsideRails](http://wiki.rubyonrails.org/rails/pages/HowToUseActiveRecordOutsideRails)

James Edward G. II
