Collation Change at database and Rails Level

Learning with Earning

First add these lines to database.yml

common: &common
encoding: utf8
collation: utf8_general_ci

 <<: *common

 <<: *common

Changing database character set and collation


1. Log into phpMyAdmin.

2. Select your database from the list on the left.

3. Click on “Operations” from the top set of tabs.

4. In the Collation box, choose your new collation from the dropdown menu. utf8_general_ci is the most common utf8 collation.

5. Now rollback or down your specific migration.

6. Now rake db:migrate / rake db:migrate:up VERSION=’migration_version_number’ [RAILS_ENV=’production/development’]

7. Click on some table of your database

8. Click “Structure” tab and check collation column value

Database Collation Change Reference

View original post


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s