Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was...
The following error message occurred when I used Eclipse to connect Mysql in the cloud server
So far, this problem has not been solved.
I don't know why this happened. Using Navicat, MySQL can be connected.
** BEGIN NESTED EXCEPTION **
com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
MESSAGE: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
STACKTRACE:
java.io.EOFException: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1997)
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:611)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1044)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775)
at com.mysql.jdbc.Connection.(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.minlu.basedao.BaseDao.(BaseDao.java:33)
at com.minlu.basedao.MainCalss.main(MainCalss.java:5)
** END NESTED EXCEPTION **
Last packet sent to the server was 0 ms ago.
STACKTRACE:
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
MESSAGE: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
STACKTRACE:
java.io.EOFException: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1997)
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:611)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1044)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775)
at com.mysql.jdbc.Connection.(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.minlu.basedao.BaseDao.(BaseDao.java:33)
at com.minlu.basedao.MainCalss.main(MainCalss.java:5)
** END NESTED EXCEPTION **
Last packet sent to the server was 0 ms ago.
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:641)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1044)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775)
at com.mysql.jdbc.Connection.(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.minlu.basedao.BaseDao.(BaseDao.java:33)
at com.minlu.basedao.MainCalss.main(MainCalss.java:5)
** END NESTED EXCEPTION **
Is the "user name" the current library name or the'root'name?
Is'PASSWORD'the current library password or'root' password here?
package com.minlu.basedao;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Properties;
public class BaseDao {
private static String USER = "minlu_****";
private static String PASSWORD = "*******3aFCDi";//自己创建数据库所设置的密码
private String MYSQL_URL="jdbc:mysql://47.244.***.***:**/minlu_****";
private static Connection conn = null;
PreparedStatement pre = null;// 预编译对象
public Connection getConn() {
return conn;
}
public static void setConn(Connection conn) {
BaseDao.conn = conn;
}
public BaseDao()
{
try {
Class.forName("com.mysql.jdbc.Driver");//加载驱动
System.out.println("加载驱动成功");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
System.out.println("找不到驱动程序类 ,加载驱动失败!");
}
try {
conn = DriverManager.getConnection(MYSQL_URL, USER, PASSWORD);//创建数据库链接对象
System.out.println("数据库链接成功2");
} catch (SQLException es) {
// TODO Auto-generated catch block
System.out.println("数据库连接失败!!!"+es.getMessage());
}
}
}
java mysql web
add a comment |
The following error message occurred when I used Eclipse to connect Mysql in the cloud server
So far, this problem has not been solved.
I don't know why this happened. Using Navicat, MySQL can be connected.
** BEGIN NESTED EXCEPTION **
com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
MESSAGE: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
STACKTRACE:
java.io.EOFException: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1997)
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:611)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1044)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775)
at com.mysql.jdbc.Connection.(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.minlu.basedao.BaseDao.(BaseDao.java:33)
at com.minlu.basedao.MainCalss.main(MainCalss.java:5)
** END NESTED EXCEPTION **
Last packet sent to the server was 0 ms ago.
STACKTRACE:
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
MESSAGE: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
STACKTRACE:
java.io.EOFException: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1997)
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:611)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1044)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775)
at com.mysql.jdbc.Connection.(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.minlu.basedao.BaseDao.(BaseDao.java:33)
at com.minlu.basedao.MainCalss.main(MainCalss.java:5)
** END NESTED EXCEPTION **
Last packet sent to the server was 0 ms ago.
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:641)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1044)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775)
at com.mysql.jdbc.Connection.(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.minlu.basedao.BaseDao.(BaseDao.java:33)
at com.minlu.basedao.MainCalss.main(MainCalss.java:5)
** END NESTED EXCEPTION **
Is the "user name" the current library name or the'root'name?
Is'PASSWORD'the current library password or'root' password here?
package com.minlu.basedao;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Properties;
public class BaseDao {
private static String USER = "minlu_****";
private static String PASSWORD = "*******3aFCDi";//自己创建数据库所设置的密码
private String MYSQL_URL="jdbc:mysql://47.244.***.***:**/minlu_****";
private static Connection conn = null;
PreparedStatement pre = null;// 预编译对象
public Connection getConn() {
return conn;
}
public static void setConn(Connection conn) {
BaseDao.conn = conn;
}
public BaseDao()
{
try {
Class.forName("com.mysql.jdbc.Driver");//加载驱动
System.out.println("加载驱动成功");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
System.out.println("找不到驱动程序类 ,加载驱动失败!");
}
try {
conn = DriverManager.getConnection(MYSQL_URL, USER, PASSWORD);//创建数据库链接对象
System.out.println("数据库链接成功2");
} catch (SQLException es) {
// TODO Auto-generated catch block
System.out.println("数据库连接失败!!!"+es.getMessage());
}
}
}
java mysql web
What do you mean with 'current library password'? TheUSER
andPASSWORD
in your code mean the username and password to connect to the MySQL server
– Mark
Jan 2 at 8:10
add a comment |
The following error message occurred when I used Eclipse to connect Mysql in the cloud server
So far, this problem has not been solved.
I don't know why this happened. Using Navicat, MySQL can be connected.
** BEGIN NESTED EXCEPTION **
com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
MESSAGE: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
STACKTRACE:
java.io.EOFException: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1997)
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:611)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1044)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775)
at com.mysql.jdbc.Connection.(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.minlu.basedao.BaseDao.(BaseDao.java:33)
at com.minlu.basedao.MainCalss.main(MainCalss.java:5)
** END NESTED EXCEPTION **
Last packet sent to the server was 0 ms ago.
STACKTRACE:
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
MESSAGE: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
STACKTRACE:
java.io.EOFException: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1997)
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:611)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1044)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775)
at com.mysql.jdbc.Connection.(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.minlu.basedao.BaseDao.(BaseDao.java:33)
at com.minlu.basedao.MainCalss.main(MainCalss.java:5)
** END NESTED EXCEPTION **
Last packet sent to the server was 0 ms ago.
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:641)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1044)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775)
at com.mysql.jdbc.Connection.(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.minlu.basedao.BaseDao.(BaseDao.java:33)
at com.minlu.basedao.MainCalss.main(MainCalss.java:5)
** END NESTED EXCEPTION **
Is the "user name" the current library name or the'root'name?
Is'PASSWORD'the current library password or'root' password here?
package com.minlu.basedao;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Properties;
public class BaseDao {
private static String USER = "minlu_****";
private static String PASSWORD = "*******3aFCDi";//自己创建数据库所设置的密码
private String MYSQL_URL="jdbc:mysql://47.244.***.***:**/minlu_****";
private static Connection conn = null;
PreparedStatement pre = null;// 预编译对象
public Connection getConn() {
return conn;
}
public static void setConn(Connection conn) {
BaseDao.conn = conn;
}
public BaseDao()
{
try {
Class.forName("com.mysql.jdbc.Driver");//加载驱动
System.out.println("加载驱动成功");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
System.out.println("找不到驱动程序类 ,加载驱动失败!");
}
try {
conn = DriverManager.getConnection(MYSQL_URL, USER, PASSWORD);//创建数据库链接对象
System.out.println("数据库链接成功2");
} catch (SQLException es) {
// TODO Auto-generated catch block
System.out.println("数据库连接失败!!!"+es.getMessage());
}
}
}
java mysql web
The following error message occurred when I used Eclipse to connect Mysql in the cloud server
So far, this problem has not been solved.
I don't know why this happened. Using Navicat, MySQL can be connected.
** BEGIN NESTED EXCEPTION **
com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
MESSAGE: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
STACKTRACE:
java.io.EOFException: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1997)
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:611)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1044)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775)
at com.mysql.jdbc.Connection.(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.minlu.basedao.BaseDao.(BaseDao.java:33)
at com.minlu.basedao.MainCalss.main(MainCalss.java:5)
** END NESTED EXCEPTION **
Last packet sent to the server was 0 ms ago.
STACKTRACE:
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.io.EOFException
MESSAGE: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
STACKTRACE:
java.io.EOFException: Can not read response from server. Expected to read 4,739,923 bytes, read 17 bytes before connection was unexpectedly lost.
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1997)
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:611)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1044)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775)
at com.mysql.jdbc.Connection.(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.minlu.basedao.BaseDao.(BaseDao.java:33)
at com.minlu.basedao.MainCalss.main(MainCalss.java:5)
** END NESTED EXCEPTION **
Last packet sent to the server was 0 ms ago.
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:641)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1044)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2775)
at com.mysql.jdbc.Connection.(Connection.java:1555)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:247)
at com.minlu.basedao.BaseDao.(BaseDao.java:33)
at com.minlu.basedao.MainCalss.main(MainCalss.java:5)
** END NESTED EXCEPTION **
Is the "user name" the current library name or the'root'name?
Is'PASSWORD'the current library password or'root' password here?
package com.minlu.basedao;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Properties;
public class BaseDao {
private static String USER = "minlu_****";
private static String PASSWORD = "*******3aFCDi";//自己创建数据库所设置的密码
private String MYSQL_URL="jdbc:mysql://47.244.***.***:**/minlu_****";
private static Connection conn = null;
PreparedStatement pre = null;// 预编译对象
public Connection getConn() {
return conn;
}
public static void setConn(Connection conn) {
BaseDao.conn = conn;
}
public BaseDao()
{
try {
Class.forName("com.mysql.jdbc.Driver");//加载驱动
System.out.println("加载驱动成功");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
System.out.println("找不到驱动程序类 ,加载驱动失败!");
}
try {
conn = DriverManager.getConnection(MYSQL_URL, USER, PASSWORD);//创建数据库链接对象
System.out.println("数据库链接成功2");
} catch (SQLException es) {
// TODO Auto-generated catch block
System.out.println("数据库连接失败!!!"+es.getMessage());
}
}
}
java mysql web
java mysql web
asked Jan 2 at 8:00


ChengXiChengXi
61
61
What do you mean with 'current library password'? TheUSER
andPASSWORD
in your code mean the username and password to connect to the MySQL server
– Mark
Jan 2 at 8:10
add a comment |
What do you mean with 'current library password'? TheUSER
andPASSWORD
in your code mean the username and password to connect to the MySQL server
– Mark
Jan 2 at 8:10
What do you mean with 'current library password'? The
USER
and PASSWORD
in your code mean the username and password to connect to the MySQL server– Mark
Jan 2 at 8:10
What do you mean with 'current library password'? The
USER
and PASSWORD
in your code mean the username and password to connect to the MySQL server– Mark
Jan 2 at 8:10
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54003025%2fcan-not-read-response-from-server-expected-to-read-4-739-923-bytes-read-17-byt%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54003025%2fcan-not-read-response-from-server-expected-to-read-4-739-923-bytes-read-17-byt%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What do you mean with 'current library password'? The
USER
andPASSWORD
in your code mean the username and password to connect to the MySQL server– Mark
Jan 2 at 8:10