scan4jobs

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

0
0

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?

  • You must to post comments
0
0

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).

  • You must to post comments
0
0

Normally, you would create a new Rails app using

rails ProjectName

To use MySQL, use

rails new ProjectName -d mysql
  • You must to post comments
Showing 2 results
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website