jar 包和 mysql 伺服器部署

來源:互聯網
上載者:User

標籤:查看   介面   password   roc   art   name   ble   ups   rip   

(1)建立好本機伺服器:

  navicat建立連結:

  連結名:自訂,這裡命名為test

  配置同jar包

(2)給予登陸許可權,loclhost_3306,右擊選擇“命令列介面”,輸入如下:

  create user ‘yonghu‘@‘%‘ identified by ‘mima‘;

  GRANT ALL ON mydb1.* TO ‘yonghu‘@‘%‘;

(3)此時雙擊test,便可以串連了。

(4)配置好jar包中的 .properties檔案,配置如下:

  spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  spring.datasource.url=jdbc:mysql://192.168.3.215:3306/mydb
  spring.datasource.username=java
  spring.datasource.password=javatest123

(5)cmd命令列:

  java -jar edifact-api-1.1.jar

  注意切換到路徑下,可以直接拖動jar包到cmd視窗中。

(6)介面地址:http://192.168.3.215:8080/edif-api

  http://192.168.3.215:8080/edif-api?year=95b&trmd=codeco&trsd=ftx

  注意用google瀏覽器

如果出現連接埠被佔用:會提示:

Description:

The Tomcat connector configured to listen on port 8080 failed to start. The port
may already be in use or the connector may be misconfigured.

Action:

Verify the connector‘s configuration, identify and stop any process that‘s liste
ning on port 8080, or configure this application to listen on another port.


方法1:

在dos下,輸入 netstat -ano|findstr 8080
在工作管理員中殺死
可以查看哪個進程佔用了8080和8009連接埠,找到佔用連接埠軟體的PID,然後在工作管理員找到對應PID的軟體,關閉結束該進程即可。如果任
務管理器中沒有顯示PID列,需要設定,查看---》選擇列---》勾選“PID(進程標識符)”。
方法2:

修改tomcat預設連接埠號碼。
修改Tomcat的設定檔。
例如:C:/tomcat5.5.25/conf/server.xml
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
Connector 節點,將port="8080"中的連接埠改為一個沒有被佔用的連接埠。

 

jar 包和 mysql 伺服器部署

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.