1. Win安装H2
1.1 下载安装包
下载后,双击运行,一直点击 next 安装即可。
1.2 连接 H2
参考 linux安装后的连接方式,是一样的。本机安装可以使用localhost:8082 进行页面登录。
2. Linux安装 H2
2.1 下载 h2 包
2.2 运行jar启动服务
java -cp h2-1.3.176.jar org.h2.tools.Server -web -webAllowOthers -tcp -tcpPort 19200 -tcpAllowOthers
后台运行:
nohup java -cp h2-1.3.176.jar org.h2.tools.Server -web -webAllowOthers -tcp -tcpPort 19200 -tcpAllowOthers &
启动日志:
[root@linkhot01 opt]# java -cp h2-1.3.176.jar org.h2.tools.Server -web -webAllowOthers -tcp -tcpPort 19200 -tcpAllowOthers
TCP server running at tcp://192.168.126.135:19200 (others can connect)
Web Console server running at http://192.168.126.135:8082 (others can connect)
2.3 登录url
tcp://192.168.126.108:19200 使用来当做url的
http://192.168.126.108:8082 页面登录使用
2.4 连接H2 Server
(1)网页访问,这里使用8082端口
sa是默认的账号,密码为NULL。我们可以直接登录
(2)DBeaver访问H2,这里使用19200端口