服务器部署问题

2016-09-18  本文已影响0人  百思不得解

如何查看Java安装目录

如果whereis和which无法使用的时候,可以

echo $JAVA_HOME


java.sql.SQLException: No suitable driver

1.检查配置文件和2.加载的jar包

jar包:查阅解决办法后 在%JAVA_HOME%\jre\lib\ext下添加mysql-connector-java-5.1.12-bin.jar 问题解决!

&rewriteBatchedStatements=true

服务器144.131.252.108:3306  root  chinaumsroot 

 mysql:test1qaz2wsx

<url>jdbc:mysql://144.131.252.108:3306/jira?useUnicode=true&amp;characterEncoding=UTF8&amp;sessionVariables=default-storage-engine=InnoDB</url>

<driver-class>com.mysql.jdbc.Driver</driver-class>

<username>jira_user</username>

<password>jira_1qaz2wsx</password>


数据库

1.创建用户生成mysql用户名为  ‘user’@‘%’

2.授权

GRANT all ON *.*  TO 'test'@‘%’;

flush priviledges;

3.查看有多少个用户

SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;

4.localhost & %

%代表任何客户机都可以连接

localhost代表只可以本机连接

所以localhost是%的子集

5.如何将localhost改为%

use mysql;

update user set host='%' where host='localhost';

6.MySQL "You can't specify target table 'X' for update in FROM clause" 错误解决方法

在官方文档有说明就是“你不能修改你从子查询出来的数据”。解决这个方法我们可以用子查询当临时表来解决。

然并卵,只能拆成一个temp table,然后用好了再删除掉

update t_wendang set isvalid='1' where (col0,col5,col6) not in (select a.col0,a.col5,a.col6 from (select col0,col5,col6 from t_wendang where isvalid='1')as a);

create table tmp as select col0,col5,col6 from t_wendang where isvalid='1';

update t_wendang set isvalid='1' where (col0,col5,col6) not in (select tmp.col0,tmp.col5,tmp.col6 from tmp);

drop table tmp;


经常性将war包从本机scp到服务器webapps目录下,避免输入密码的方法

1. 在机器Client上root用户执行ssh-keygen命令,生成建立安全信任关系的证书。

ssh-keygen -b 1024 -t rsa

2. 将公钥证书id_rsa.pub复制到机器Server的root家目录的.ssh子目录中,同时将文件名更换为authorized_keys。

scp -p .ssh/id_rsa.pub root@192.168.3.206:/root/.ssh/authorized_keys


自动化部署脚本

cd ~/Documents/taiZhangProject/taizhang/Account

mvn clean package

cd target

mv Account-0.0.1-SNAPSHOT.war Account.war

scp Account.war root@144.131.252.109:/home/tomcat/webapps


遇到的问题:

src/main/java 中与 src里面的代码居然不一致

上一篇下一篇

猜你喜欢

热点阅读