ssh -p22 user@49.233.186.242 #用户名@公网地址
passwd :
scp /path/filename username@servername:/path ;# 直接使用没有权限
进入tomcat/logs/文件夹下 tail -f catalina.out
http://49.233.186.242/spring/main
# 进入mysql数据库
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
## springboot 连接远程服务器的数据库
#端口号配置
server:
port: 8080
spring:
#模板引擎配置
thymeleaf:
prefix: classpath:/templates/
suffix: .html
mode: HTML
encoding: UTF-8
cache: false
servlet:
content-type: text/html
#静态文件配置
resources:
static-locations: classpath:/static/,classpath:/META-INF/resources,classpath:/templates/
#jdbc配置jdbc:mysql://localhost:3306
datasource:
url: jdbc:mysql://49.233.186.242:3389/db1?useUnicode=true&characterEncoding=utf8&useSSL=false
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
#mybatis配置
mybatis:
#映射文件路径
mapper-locations: classpath:mapper/*.xml,classpath:generator/*.xml
#模型所在的保命
type-aliases-package: com.yt.springtest.model
原文:https://www.cnblogs.com/rainbowbridge/p/12157354.html