5

I have mydatabase.db file and I want it to be conveted to mydatabase.sql file.

How to do this?. Thank you.

Is there any sqlite command?. or any software to convert this, or any mysql command?.

user3317477
  • 73
  • 1
  • 1
  • 5

3 Answers3

6

There is simple sqlite command:

sqlite3 database.sqlite3 .dump >> database.sql

Note the dot before "dump". This is special command to sqlite3 cli client eg. dot-commands.

For Ubuntu, sqlite3 can be installed by:

apt-get install sqlite3
Adam Dobrawy
  • 1,145
  • 13
  • 14
4

You can try Valentina Studio (license is free, crashes far less than MesaSQLite)

Steps:

  1. Open the .db file in Valentina Studio
  2. Select a table in schema editor
  3. Right/Alternate click the table name
  4. Generate SQL
  5. Show Create

And in a new editor tab that appears, you will have a sql create statement you can use for your mysql server. Note: Depending on the complexity of your table you may need to apply corrected syntax for it to work in mysql.

If you need to copy the rows contained in your selected table you can create a dump (from right click on table) and then import.

Nadeem_MK
  • 7,533
  • 7
  • 50
  • 61
2

DB Browser for SQLite http://sqlitebrowser.org it's free and unlike Valentina Studio requires no registration and does not have a 10 minute timeout period. To use just open .db file then from the file menu select 'Export' -> 'Database to SQL file..'

my2cents
  • 41
  • 1
  • 2