服务器 Gind.cn

服务器问题集锦,包括 Linux(Ubuntu, Centos,Debian等)和Windows Server服务器

挫败的JDBC MySQLexception

因此,在我的旧服务器因服务器故障而死的情况下,我正在设置新的服务器。 我碰到的唯一的巨石是JDBC设置。 我的服务器运行一个原来在旧服务器上工作正常的Java程序。 我将切换到追逐,并告诉你什么问题是…当我尝试连接使用127.0.0.1以及本地主机时,这是堆栈跟踪: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '????????????????' at line 1 com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1049) com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593) com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525) com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986) com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620) com.mysql.jdbc.ConnectionImpl.configureClientCharacterSet(ConnectionImpl.java:1890) com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3523) com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2386) 相当模糊不是吗? 这是我用来连接到服务器(在我的旧服务器上工作正常)的代码: Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection con = java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/schema?user=user_name&password=pass_word"); 以下是关于我的服务器的一些信息:服务器运行Debian Squeeze,MySQL设置正常,因为phpMyAdmin完美工作,Java版本1.5.0,JDBC Connector / J版本5.1.14,CLASSPATH已被设置为正确的目录,端口正确转发3306。 […]