Forum: Rails-core (closed, excessive spam) How to use mysql database on ruby

Posted by torso (Guest)
on 2008-06-24 12:26
(Received via mailing list)
I have fedora 8 and ruby on rails installed, but i need to use mysql
database, not sqlite3. How i can change it to mysql? Can somebody help
me?
Posted by Craig Demyanovich (Guest)
on 2008-06-24 13:04
(Received via mailing list)
You can run

rails -d mysql

to generate a rails app that uses mysql as its database.  See

rails -h

for more options.

Or, you could change the config/database.yml file in your existing
rails app to point at mysql if you know what to change. Here's how a
basic one might look:

development:
  adapter: mysql
  database: blah_development
  username: root
  password:

test:
  adapter: mysql
  database: blah_test
  username: root
  password:

production:
  adapter: mysql
  database: blah_production
  username: root
  password:

Just change blah to your rails app name. And, you may want to make
yours use more secure credentials instead of root and an empty
password. ;-)

Regards,
Craig
Posted by torso (Guest)
on 2008-06-25 10:20
(Received via mailing list)
Thank you. It works now.

On Jun 24, 2:04 pm, "Craig Demyanovich" <cdemyanov...@gmail.com>
Posted by Jarkko Laine (jarkko)
on 2008-06-25 10:29
Attachment: smime.p7s (2,36 KB)
(Received via mailing list)
On 25.6.2008, at 11.19, torso wrote:
> Thank you. It works now.

Just for future reference, you shouldn't use this list for help
requests, this is a list for discussing the development of the
framework. Usage questions should be sent to the general Rails mailing
list, http://groups.google.com/group/rubyonrails-talk (or the Finnish
list, http://groups.google.com/group/finnishrails, which has plenty of
people able to help with your problems but not too many questions
lately ;-).

//jarkko

--
Jarkko Laine
http://jlaine.net
http://dotherightthing.com
http://www.railsecommerce.com
http://odesign.fi
Posted by torso (Guest)
on 2008-06-25 10:40
(Received via mailing list)
Kiitos neuvosta, en tosiaan tajunnut että oon väärässä gruopissa, mut
nyt siirsin sen toisen kysymyksen sinne talk grouppiin..
Posted by johnmcauley@gmail.com (Guest)
on 2008-06-25 10:43
(Received via mailing list)
Have said that, here is a great resource for accessing databases
through ruby: 
http://www.troubleshooters.com/codecorn/ruby/datab...
This topic is locked and can not be replied to.