我试图在java中使用以下命令连接到我的sql数据库
connection = DriverManager.getConnection(url, user, pass);
网址在哪里
jdbc:mysql://www.SampleSite.net:2222/DatabaseName
虽然我只是执行上面的命令,但我收到以下错误
`com.mysql.jdbc.PacketTooBigException: Packet for query is too large (5526600 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:605)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1078)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2412)
...
我该做什么?我只尝试连接,因此查询不是那么长。
提前致谢!