Mysql connection error: Headers and client library minor version Mismatch

Asked

Viewed 2,328 times

2

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

The error occurs when PHP version 5.4.16 is used, in version 5.6 the error no longer occurs. So I believe the error is in the php version, but I don’t 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 before the connection

  • Also put Mysql and Mysql client versions (via phpinfo())

  • PHP and database are on separate machines?

  • 1

    PHP Info Information: MYSQL Client API version 5.6.31, MYSQLI Client API library version 5.6.31

  • 1

    I believe you have already discovered the problem: "The error occurs when PHP version 5.4.16 is used, in version 5.6 the error no longer occurs" I think will only solve when you leave the two versions equal

1 answer

1

Exchange the php-mysql for php-mysqlnd (from Mysql 5.6 onwards)

yum remove php-mysql

yum install php-mysqlnd

or

apt-get remove php5-mysql

apt-get install php5-mysqlnd

With me it worked. I sought the solution in here

Browser other questions tagged

You are not signed in. Login or sign up in order to post.