Changes between Version 7 and Version 8 of waue/2010/0831


Ignore:
Timestamp:
Sep 3, 2010, 12:18:40 PM (14 years ago)
Author:
waue
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • waue/2010/0831

    v7 v8  
    2929 * [http://www.mysql.com/products/connector/ mysql 的 jdbc 驅動程式]
    3030
    31 = mysql 遠端登入方法 =
     31
     32若出現以下錯誤
     33{{{
     34#!text
     35Caused by: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
     36
     37The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
     38}}}
     39
     40代表程式碼連線到 mysql 的設定方法有錯誤,通常是Mysql 只聽 localhost,但你讓他去連 your_ip ,導致出現這樣的訊息,解決方法就是
     41
     42A. 連線到 local
     43{{{
     44#!text
     45        DBConfiguration.configureDB(conf, "com.mysql.jdbc.Driver", "jdbc:mysql://localhost/school", "waue", "wauenchc");
     46}}}
     47
     48B. 讓mysql 可以遠端存取
     49
     50= mysql 遠端存取方法 =
    3251
    3352修改 /etc/mysql/my.cnf