Search Our Database
How to resolve MySQL ‘Headers and client library minor version mismatch’ error in DirectAdmin
Introduction
This guide explains how to resolve the MySQL ‘Headers and client library version mismatch’ error in DirectAdmin. This issue typically arises when MySQL has been updated and PHP is rebuilt through custombuild, but websites still encounter the error:
Warning: mysql_connect() [function.mysql-connect]: /Headers and client library minor version mismatch/. /Headers:50157 Library:50511/
This error indicates a version mismatch between the MySQL headers and the client library. To resolve this issue, you need to clean up custombuild and rebuild PHP. This guide provides the necessary steps to fix this issue and ensure that your websites work correctly after MySQL and PHP updates.
Prerequisites
- Root or sudo access to the server running DirectAdmin
- Basic familiarity with command-line interface (CLI)
- DirectAdmin custombuild setup
Step-by-Step Guide
1. Log in to your server with root access by running the following command:
ssh root@your_remote_server_ip
2. Change directory to the custombuild directory where the custombuild scrips are located by running the following command:
cd /usr/local/DirectAdmin/custombuild
3. Run the following command to clean up custombuild files and dependencies.
./build clean
This removes any outdated build artifacts and prepares for a fresh rebuild.
4. Once the cleanup is complete, rebuild PHP using custombuild by running the following command:
./build php n
The n option ensures that PHP is rebuilt without asking for confirmation.
5. After the rebuild process completes, verify that the websites no longer show the ‘Headers and client library version mismatch’ error. You can check the website’s front end to confirm that the issue has been resolved.
Conclusion
By following these steps, you can resolve the MySQL ‘Headers and client library minor version mismatch’ error in DirectAdmin. Cleaning up and rebuilding PHP ensures compatibility between the updated MySQL version and the PHP MySQL client library. This solution helps restore normal website functionality after updating MySQL and PHP through DirectAdmin’s custombuild system. For additional assistance or if you encounter any issues, please contact our support team at support@ipserverone.com.
Article posted on 19 April 2020 by Louis.