CREATE A NEW RUBY ON RAILS APPLICATION USING MYSQL INSTEAD OF SQLITE

Ashish Pandey

Total Post:128

Points:898
Posted by  Ashish Pandey
 1052  View(s)
Ratings:
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?
  1. Manoj Bhatt

    Post:154

    Points:1086
    Re: Create a new Ruby on Rails application using MySQL instead of SQLite

    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:


    development:

      adapter: mysql2

      database: db_name_dev

      username: koploper

      password:

      host: localhost

      socket: /tmp/mysql.sock

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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!