Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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 ?

share|improve this question
    
is there data to migrate? –  Rodrigo Zurek Jun 16 at 5:42
    
possible duplicate of Migrate database from Postgres to MySQL –  zed_0xff Jun 16 at 7:01
add comment

2 Answers 2

up vote 0 down vote accepted

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

share|improve this answer
add comment

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.