I am working on a project in Rails 4. I was using sqlite3 database previously. But now I want to switch the database from sqlite3 to mysql. But all my previous application data should be copied so when I use mysql database none of my table data may be deleted.
Asked
Active
Viewed 70 times
0
-
i am getting the error whenever i am running rake db:schema:load – Mahesh Sharma Mar 27 '17 at 05:15
1 Answers
1
try this
1. cd /path/to/rails_app/db
2. sqlite3 DATA-BASE-NAME .dump > database.sql
3. mysql -u username -p -h localhost DATA-BASE-NAME < database.sql
Hope it will help you.

Hardik Upadhyay
- 2,639
- 1
- 19
- 34
-
-
i am successful in changing my database...but some another method....but now i am facing issue in one of my file using strftime query.......i have posted one question.......rply in that if you know..........http://stackoverflow.com/questions/43061570/strftime-error-while-switching-my-database-from-sqlite3-to-mysql-in-rails4 – Mahesh Sharma Mar 28 '17 at 05:58
-
-
i have upvoted you....you also upvote me in all my questions....!!! – Mahesh Sharma Apr 04 '17 at 09:56