Home > DeveloperSection > Forums > Create a new Ruby on Rails application using MySQL instead of SQLite
Ashish Pandey

Total Post:128

Posted on    December-28-2014 11:48 PM

 Ruby on Rails Ruby on Rails  MYSQL  Ruby 

 1 Reply(s)
 1010  View(s)
Rate this:
I want to create my Rails application with MySQL, because I like it so much. How can I do that in the latest version of Rails instead of the default SQLite?

Manoj Bhatt
Manoj Bhatt

Total Post:154

Posted on    December-29-2014 12:12 AM

If you already have a rails project, change the adapter in the config/database.yml file to mysql and make sure you specify a valid username and password, and optionally, a socket:


  adapter: mysql2

  database: db_name_dev

  username: koploper


  host: localhost

  socket: /tmp/mysql.sock

Next, make sure you edit your Gemfile to include the mysql2 or activerecord-jdbcmysql-adapter (if using jruby).

Don't want to miss updates? Please click the below button!

Follow MindStick