Maduri
Maduri

Reputation: 279

What is reason for mysql database couldn't insert huge data set continuously?

I'm trying to read given web link, web pages paragraph by paragraph and insert that data into database.

Every time after reading and inserting about 20 web pages that gives following error messages.

I'm working in Xampp mysql server. After clearing history,cookies then work again properly. Then after reading web pages and inserting same errors occurs.

Isn't there any proper solution? Some stack overflow question mentioning about some idea to edit some config file.

Because of working me in windows environment I'm not clear about what they are mentioning.They mention increase maximum connection. But not clear about how I can edit some file (Not clear about where store that config file in windows environment) they mentioning.

Error message:

 The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    at sun.reflect.GeneratedConstructorAccessor8.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:343)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2137)
    ... 12 more
Caused by: java.net.SocketException: No buffer space available (maximum connections reached?): connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:253)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:292)
    ... 13 more
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
    at sun.reflect.GeneratedConstructorAccessor8.newInstance(Unknown Source)

Upvotes: 2

Views: 331

Answers (1)

Vishvesh Phadnis
Vishvesh Phadnis

Reputation: 2588

in Mysql my.ini or it may be my-default.ini file set max_allowed_packet=32M

after that restart mysql service.

you can specify size as per your need.

or

with mysql command shell

shell > mysql --max_allowed_packet=32M

Upvotes: 1

Related Questions