2

In my current application i am using PostgreSQL Data base,

but I want to change the PostgreSQL database into MYSQL DB.

if it's impossible ?

2

2 Answers 2

7

Step 1

Make a backup copy of your data

For Rails 3, install the YAML DB gem: https://github.com/ludicast/yaml_db

For Rails 2.x install the YAML DB plugin:

script/plugin install git://github.com/adamwiggins/yaml_db.git

Run the dump task

rake db:dump

Step 2

Update your config/database.yml file.

Step 3 :

gem install mysql

Have rake create your database

rake db:create

rake db:schema:load

Step 4

Use YamlDb to reload your data into MySql

rake db:load

Sign up to request clarification or add additional context in comments.

1 Comment

How to run on Heroku?
0

this is a duplicate

Migrate database from Postgres to MySQL

dont forget to change the gems and your database config file to something like this:

development:
  adapter: mysql2
  encoding: utf8
  database: my_db_name
  username: root
  password: my_password
  host: 127.0.0.1
  port: 3306

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.