服务器搭建 h2
1.下载 h2 的 jar 包,使用 1.4.192 版本的,可以从 maven 仓库下载: https://repo1.maven.org/maven2/com/h2database/h2/1.4.192/h2-1.4.192.jar
在服务器目录下新建 h2 目录,将 h2 的 jar 包上传到这个目录中
或直接在服务器上执行
wget https://repo1.maven.org/maven2/com/h2database/h2/1.4.192/h2-1.4.192.jar
h2 目录下执行命令,启动 h2 的后台服务
java -cp h2-1.4.192.jar org.h2.tools.Server -web -webAllowOthers -tcp -tcpPort 19200 -tcpAllowOthers &
使用浏览器访问 http://你服务器地址:8082/ ,出现如下图页面,说明连接上了 h2 服务
默认的用户名 sa 密码 为空
ip:10.221.146.201 端口:19200 数据库/模式:~/test 用户名:sa 密码为空
jdbc 的 url 为:jdbc:h2:tcp://10.221.146.201:19200/~/test
jdbc:h2:tcp://vuereact.top:19200/~/test