Evelyn St Evelyn St - 1 year ago 86
MySQL Question

How can I configure database.yml from an existing database on bluehost?

I already have a database and a user/password that I create from cPanel "MySQL Wizard", but I'm having problems while configuring the database.yml file. I don't know how it should look like.

When I created my app on my computer to run on localhost:3000, only running the "rake db:create" command made everything works, but now that I have a database that was created before the app, I don't know how can I configure it.

I tried to read the some rubyonrails.org guides, but it didn't help me.

Answer Source

A Rails database.yml for a MySQL database usually looks like this:

  adapter: mysql2
  encoding: utf8
  database: blog_development
  pool: 5
  username: root
  socket: /tmp/mysql.sock

Just add your configuration for your environment following the same structure:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download