Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MySQL access from within Ruby

Status
Not open for further replies.

peterv6

Programmer
Sep 10, 2005
70
US
I'm a Ruby Newbie, and I haven't been able to find any information on accessing a MySQL database using Ruby. Can anyone post some code that does that, or point me to some documentation that will show me what I need and how to connect to and use a MySQL database? All help will be greatly appreciated!

PETERV
Syracuse, NY &
Boston, MA
 
All you should have to do is tell it to use a MySQL database in the file config/database.yml

Code:
development:
  adapter: mysql
  database: My_development_Database
  username: UserName
  password: 
  host: localhost

-------------------------
Call me barely Impressive Captain.
 
Unfortunately, this solution isn't what I'm really looking for. What I need is a way to use the Ruby DBI from within a Ruby script to connect to the MySQL database.

PETERV
Syracuse, NY &
Boston, MA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top