php - mysql_connect() : Headers and client library minor version mismatch. header :50531 库:50613

标签 php mysql header mismatch

我真的很难在 debian wheezy 上修复这些错误。

mysql_connect(): Headers and client library minor version mismatch. Headers:50531 Library:50613 core.php on line 317

今天升级到 php 5.4、ioncube loaders 4.4.3、xcache 3.0.3 和 percona 5.6 后,问题出现了一段时间。

到目前为止,在我尝试解决问题的过程中,我已经尝试过...

  1. 卸载 php(包括清除安装文件)
  2. 降级到 php 5.3 然后升级回来
  3. 降级回 percona 5.5 并升级回来
  4. 正在卸载 ioncube header
  5. 正在卸载 xcache

不幸的是,这些都没有帮助......

--

第 317 行开始于:

 $link = $this->
  /**
    * Initialize database connection(s)
    *
    * Connects to the specified master database server, and also to the slave server if it is specified
    *
    * @param        string  Name of the database server - should be either 'localhost' or an IP address
    * @param        integer Port of the database server (usually 3306)
    * @param        string  Username to connect to the database server
    * @param        string  Password associated with the username for the database server
    * @param        boolean Whether or not to use persistent connections to the database server
    * @param        string  Not applicable; config file for MySQLi only
    * @param        string  Force connection character set (to prevent collation errors)
    *
    * @return       boolean
    */
    function db_connect($servername, $port, $username, $password, $usepconnect, $configfile = '', $charset = '')
    {
            if (function_exists('catch_db_error'))
            {
                    set_error_handler('catch_db_error');
            }

            // catch_db_error will handle exiting, no infinite loop here
            do
            {
                    $link = $this->functions[$usepconnect ? 'pconnect' : 'connect']("$servername:$port", $username, $password);
            }
            while ($link == false AND $this->reporterror);

            restore_error_handler();

            if (!empty($charset))
            {
                    if (function_exists('mysql_set_charset'))
                    {
                            mysql_set_charset($charset);
                    }
                    else
                    {
                            $this->sql = "SET NAMES $charset";
                            $this->execute_query(true, $link);
                    }
            }

            return $link;
    }

最佳答案

当我最近将我的 ubuntu 服务器升级到 13.04 时我遇到了同样的问题无论如何这只是来自 libmysqlclient 的警告我也有 mariadb ,你可以使用 php5-mysqlnd而不是 php5-mysql 这为我修复了它。

sudo apt-get remove php5-mysql

sudo apt-get install php5-mysqlnd

关于php - mysql_connect() : Headers and client library minor version mismatch. header :50531 库:50613,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19293354/

相关文章:

php - 尝试使用 gmail 发送电子邮件时出现 Cakephp 3 错误

使用 `in` 子句的 C# 参数化查询 MySQL

您可以对 C_INCLUDE_PATH 使用通配符吗

html - <header> 中的链接不可点击

php - 如果我需要这些键同时具有值​​(从数据库传递),如何将键添加到 PHP 数组?

php - 尝试在 PHP 中组合数组中的值

php - 如何在使用 Zend_File_Transfer_Adapter_Http() 上传时调整图像大小;

MySql 主键不是 int

mysql - 在mysql语句中回显?

带有随机 ID 变量的 PHP header