Error connecting to MySQL: Headers and client library minor version mismatch

2

When connecting to MYSQL database using the mysqli class I am getting the error: Warning: mysqli :: mysqli (): Headers and client library minor version mismatch .

The error occurs when using version 5.4.16 of PHP, in version 5.6 the error no longer occurs. So I believe the error is in the php version, but I do not have access to adjust the client version so I would spend trying to find a solution without having to change the PHP version.

The connection line is:

$mysqli = new \mysqli($db['Host'], $db['User'], $db['Pass'], $db['Banco']);

I'm using the composer, so a \ before the connection

    
asked by anonymous 09.01.2017 / 19:27

1 answer

1

Change php-mysql to php-mysqlnd (from MySQL 5.6)

yum remove php-mysql

yum install php-mysqlnd

or

apt-get remove php5-mysql

apt-get install php5-mysqlnd

With me it worked. I searched the solution at here

    
25.04.2018 / 20:04