I wrote a C++/QT application that uses a mysql database for its data. It's using the mysql++ library. I now want it to be able to export and import its data to/from files.

I could write an own file format, but I'd like to elude this efford, if possible.

Is there an easy possibility to export a mysql table into a file and to reimport this file with C++?

I heard of sqlite, but as far as I read, migrating from mysql++ to sqlite is not that easy, because it includes a switch of the complete database backend.

有帮助吗?

解决方案

You can use "LOAD DATA " and "SELECT ... INTO OUTFILE"

That should have great performance. You may not use the outfiles further as easily as you want.

其他提示

The best way to export/import data from/to a database is xml files.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top