在Mac OSX上打开h2数据库文件

时间:2014-07-10 19:59:18

标签: database macos h2 dbvisualizer razorsql

我在Mac OS X上打开h2数据库文件时遇到了问题。我尝试了'DbVisualizer'和'RazorSQL',但是h2文件无法正常打开。他们表现出奇怪的角色。

我是在做错事还是有更好的程序在Mac上打开h2数据库文件?

Q7"�����hQ9! � �!�#�%�'t(])<+%-.�/�0�2�4�5~6a8J:3;<=�?�A�B�C~EgGQH;G!B&QOFF,0,,,falseE2F!B'QOFF,0,,,falseE1D!B ROFF,0,,d,falseE0B B)QOFF,0,,,falseS0,1,2,3,4,5,6,7A!<*QOFF,0,,,falseE1@!<+QOFF,0,,,falseE5>!< ROFF,0,,d,falseE0< <,QOFF,0,,,falseQ0,1,2,3,4,5,6;!5.QOFF,0,,,falseE2:!5/QOFF,0,,,falseE39!5QOFF,0,,,falseE17!5 ROFF,0,,d,falseE05 5QOFF,0,,,falseK0,1,2,34!/QOFF,0,,,falseE13!/QOFF,0,,,falseE21!/ ROFF,0,,d,falseE0/ /QOFF,0,,,falseK0,1,2,3.!(wQOFF,0,,,falseE2-!(xQOFF,0,,,falseE4,!(yQOFF,0,,,falseE1*!( ROFF,0,,d,falseE0( ({QOFF,0,,,falseO0,1,2,3,4,5'! |QOFF,0,,,falseE1&! }QOFF,0,,,falseE2$! ~QOFF,0,,,falseG1,2"!  ROFF,0,,d,falseE0   �QOFF,0,,,falseK0,1,2,3!�QOFF,0,,,falseE4!�QOFF,0,,,falseE3!�QOFF,0,,,falseE2!�QOFF,0,,,falseE1!�QOFF,0,,,falseE6! ROFF,0,,d,falseE0 

2 个答案:

答案 0 :(得分:0)

您需要使用JDBC URL连接到数据库,而不是尝试使用文件编辑器打开数据库文件,例如jdbc:h2:~/data/test

答案 1 :(得分:0)

您可以使用The Shell Tool,例如

java -cp h2*.jar org.h2.tools.Shell

将要求您提供数据库URL,JDBC驱动程序,用户名和密码。连接设置也可以设置为命令行参数。连接后,您将获得选项列表。

sql> select * from test
...> where id = 0;

对于GUI,您可以尝试DBeaver。另请检查:Frontend tool to manage H2 database

在macOS上,您也可以通过h2安装brew install h2,然后运行h2