How may I copy all my existing application Data fr

2019-09-15 18:14发布

This question already has an answer here:

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.

1条回答
走好不送
2楼-- · 2019-09-15 18:52

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.

查看更多
登录 后发表回答