Welcome Guest, Not a member yet? Register   Sign In
ERROR in mysqli_driver.php
#1

Hello.

I am having a  problem with mysqli_driver.php.

ERROR - 2018-01-21 16:06:50 --> Severity: Warning --> mysqli::query(): MySQL server has gone away ...\system\database\drivers\mysqli\mysqli_driver.php 305
ERROR - 2018-01-21 16:06:50 --> Severity: Warning --> mysqli::query(): Error reading result set's header ...\system\database\drivers\mysqli\mysqli_driver.php 305
ERROR - 2018-01-21 16:06:50 --> Query error: MySQL server has gone away - Invalid query: SELECT * FROM `shoes` WHERE `strId` = '0047TANWU' LIMIT 1

The table `shoes` is have 530 000 rows...

How can I fix this error?
Reply
#2

@nvv,
More information is needed. Have you configured CI correctly (the database parameters)? Is PHP configured correctly? What version of PHP are you using? Is you MySQL database active? What version of CI are you using?
Reply
#3

(01-21-2018, 08:58 AM)php_rocs Wrote: @nvv,
More information is needed.  Have you configured CI correctly (the database parameters)? Is PHP configured correctly? What version of PHP are you using? Is you MySQL database active?  What version of CI are you using?

CI = 3.1.7
APACH-PHP7
MySQL-5.7
PHP7

Until the error, everything worked fine. Now everything is working fine.

Increased the parameters in the mysql config.
But the mistake was. Perhaps you need to test this point.


Thanks!
Reply
#4

This can be caused by lots of different things.

Code:
mysql/bin/my.ini

setting:

connect_timeout = 300
default_socket_timeout = 300


This should be set to FALSE because it causes problems.

PHP Code:
// ./application/config/database/php
'pconnect' => TRUE// change this to false 

Reconnecting / Keeping the Connection Alive

If the database server’s idle timeout is exceeded while you’re doing some heavy PHP lifting (processing an image,
for instance), you should consider pinging the server by using the reconnect() method before sending further queries,
which can gracefully keep the connection alive or re-establish it.

PHP Code:
$this->db->reconnect(); 

You may also need to raise the MySQL packet size...
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

(This post was last modified: 01-22-2018, 12:16 PM by nvv.)

'pconnect' was FALSE.

Ok. I will try.
Reply
#6

(This post was last modified: 01-27-2018, 10:51 AM by nvv.)

Sorry, MySQL was 5.6

I was updated MySQL to 5.7 and site is working fine now.

Fanks.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB