Home » Questions » Computers [ Ask a new question ]

Create a new Ruby on Rails application using MySQL instead of SQLite

Create a new Ruby on Rails application using MySQL instead of SQLite

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?

Asked by: Guest | Views: 320
Total answers/comments: 4
Guest [Entry]

"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)."
Guest [Entry]

"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)."
Guest [Entry]

"For Rails 3 you can use this command to create a new project using mysql:

$ rails new projectname -d mysql"
Guest [Entry]

"Go to the terminal and write:

rails new <project_name> -d mysql"