第一步:到官网下载h2-2015-10-11.zip压缩包,解压并上传到centos6.5服务器上
如我的h2上传到/usr/local/下,完整路径为/usr/local/h2
第二步:开放端口
执行命令:vi /etc/sysconfig/iptables
增加两行:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8082 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9092 -j ACCEPT
重启防火墙: /etc/init.d/iptables restart
第三步:以Server模式运行h2数据库(H2数据库连接端口为9092,网页端连接端口为8082)
java -jar h2-1.4.190.jar -webAllowOthers -tcpAllowOthers &
或
java -jar h2-1.4.190.jar org.h2.tools.Server -tcp -web -tcpAllowOthers -tcpPort 9092 -webAllowOthers -webPort 8082
第四步:h2数据库控制台地址
http://服务器IP:8082/test.do?jsessionid=6e3acd277bf2bc61e0fc477b6f556b1b
账号:sa
密码为空
如我的h2上传到/usr/local/下,完整路径为/usr/local/h2
第二步:开放端口
执行命令:vi /etc/sysconfig/iptables
增加两行:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8082 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 9092 -j ACCEPT
重启防火墙: /etc/init.d/iptables restart
第三步:以Server模式运行h2数据库(H2数据库连接端口为9092,网页端连接端口为8082)
java -jar h2-1.4.190.jar -webAllowOthers -tcpAllowOthers &
或
java -jar h2-1.4.190.jar org.h2.tools.Server -tcp -web -tcpAllowOthers -tcpPort 9092 -webAllowOthers -webPort 8082
第四步:h2数据库控制台地址
http://服务器IP:8082/test.do?jsessionid=6e3acd277bf2bc61e0fc477b6f556b1b
账号:sa
密码为空