Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7523539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:49:57+00:00 2026-05-30T02:49:57+00:00

We are currently using SQLite3 as our database and want to switch it to

  • 0

We are currently using SQLite3 as our database and want to switch it to MySQL before we send our Rails app live via Passenger and Nginx to our Linode Ubuntu 10.04 Lucid box.

we set up the msql server on our linode ubuntu 10.04 box
and set a password for the root user. how do we configure database.yml ? what are the steps to set up this MySQL database? We have the mysql2 gem installed and in our Gemfile.

What does database.yml need to look like in order to deploy with MySQL ?

Does the database need any specific name as in database name?

Do we go about running rake db:create on our machine or run it on our Ubuntu box?

current database.yml

# SQLite version 3.x
# gem install sqlite3
# 
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 2000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 2000

production:
adapter: mysql2
encoding: utf8
database: production
pool: 5
username: root
password: "mysql password"
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T02:49:58+00:00Added an answer on May 30, 2026 at 2:49 am

    Did you try a simple connection test? If not, here is a script to test the connection to your db.

    #! /usr/bin/ruby
    
    # getting required gems  
    require 'rubygems'  
    require 'mysql'  
    
    ## ----- test the connection -----  
    # http://rubydoc.info/gems/mysql/2.8.1/frames  
    # real_connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, sock=nil, flag=nil)
    mysql = Mysql.connect('localhost', 'root', 'password', 'db_name', 3006, '', '')  
    
    ## ----- if connected, will list databases -----  
    puts mysql.list_dbs().to_s  
    

    In case the ‘mysql’ did not install properly, you will have to custom configure the install properties. On my Mac (different that you linux machine), I referenced this blog post to get something like this,

    sudo env ARCHFLAGS="-arch x86_64" gem install --no-rdoc --no-ri mysql -- --with mysqlconfig=/usr/local/mysql/bin/mysql_config

    UPDATE – Had to reinstall mysql gem for a different ruby version, and removing the architecture notation allowed me to install the gem.

    sudo gem install --no-rdoc --no-ri mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently using the awesome attachment-fu plugin for a Rails app, but as a
I'm currently using SQLite3 with a simple post and image sharing app, similar to
I want to save an image to the database using SQLite. I send the
I am currently using mysql database at server and for local sqlite in my
currently I am using: $result = new SQLite3(sprintf(users/USERIDS_DB.sqlite)); $numRows = $result->exec (SELECT count(*) FROM
Currently using System.Web.UI.WebControls.FileUpload wrapped in our own control. We have licenses for Telerik. I
Currently using Google Analytics as a supplement to our paid tracking software, but neither
I'm currently using VS2005 Profesional and .NET 2.0, and since our project is rather
i am new to iPhone, I am using sqlite3 as my database. There are
Currently I have a Rails 2.3 app that is a CMS serving over 100

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.