如何查看Java安裝目錄
如果whereis和which無法使用的時(shí)候,可以
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
服務(wù)器144.131.252.108:3306 ?root ?chinaumsroot?
?mysql:test1qaz2wsx
<url>jdbc:mysql://144.131.252.108:3306/jira?useUnicode=true&characterEncoding=UTF8&sessionVariables=default-storage-engine=InnoDB</url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<username>jira_user</username>
<password>jira_1qaz2wsx</password>
數(shù)據(jù)庫
1.創(chuàng)建用戶生成mysql用戶名為? ‘user’@‘%’
2.授權(quán)
GRANT all ON *.*? TO 'test'@‘%’;
flush priviledges;
SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;
4.localhost & %
%代表任何客戶機(jī)都可以連接
localhost代表只可以本機(jī)連接
所以localhost是%的子集
use mysql;
update user set host='%' where host='localhost';
6.MySQL "You can't specify target table 'X' for update in FROM clause" 錯(cuò)誤解決方法
在官方文檔有說明就是“你不能修改你從子查詢出來的數(shù)據(jù)”。解決這個(gè)方法我們可以用子查詢當(dāng)臨時(shí)表來解決。
然并卵,只能拆成一個(gè)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;
經(jīng)常性將war包從本機(jī)scp到服務(wù)器webapps目錄下,避免輸入密碼的方法是
1. 在機(jī)器Client上root用戶執(zhí)行ssh-keygen命令,生成建立安全信任關(guān)系的證書。
ssh-keygen -b 1024 -t rsa
2. 將公鑰證書id_rsa.pub復(fù)制到機(jī)器Server的root家目錄的.ssh子目錄中,同時(shí)將文件名更換為authorized_keys。
scp -p .ssh/id_rsa.pub root@192.168.3.206:/root/.ssh/authorized_keys
自動(dòng)化部署腳本
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里面的代碼居然不一致