I made a database using H2Database, the database file is saved as *.db file in my documents,
how to import that *.db file to WAMP server?
- 27,064
- 61
- 75
- 116
- 47
- 2
- 7
1 Answers
Pretty certain you cannot import the *.db file directly. But since WAMP stands for Windows, Apache, MySQL and PHP you would need to have the actual H2Database database itself converted to SQL so it can easily be imported into MySQL. As per the following Stack Overflow answer, within H2Database database you could run the following command to export the database as SQL:
SCRIPT TO '[the target script file to export to]'
Of course replacing [the target script file to export to] with the actual name of the SQL file you would like to export to. Another option is to use the script tool like this to export the DB in SQL format:
java org.h2.tools.Script -url [database url] -user [username] -password [password] -script [the target script file to export to]
Replacing [database url] with the actual database URL, [username] with the actual username, [password] with the actual password and [the target script file to export to] with the actual name of the script file you would like to export to.
- 53,069
- 19
- 162
- 212
-
1@Djhseen If you cannot do this, you are in over your head. Sorry. – Giacomo1968 Nov 20 '14 at 18:49