mysql_connect(): 标头和客户端库次要版本不匹配.标题:50531 库:50613.


mysql_connect(): Headers and client library minor version mismatch. Headers:50531 Library:50613

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

mysql_connect((:标头和客户端库次要版本不匹配。页码:50531 库:50613 核心.php 317行

升级到php 5.4,ioncube加载器4.4.3,xcache 3.0.3和percona 5.6之后,这个问题今天发生了一段时间。

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

  1. 卸载 php(包括清除安装文件(
  2. 降级到 php 5.3 然后升级回来
  3. 降级回 percona 5.5 并升级回
  4. 卸载离子立方体接头
  5. 卸载缓存

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

--

第 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 5.4 和 php 5.3 上清除能力并重新安装 php 5.3 来解决此问题

在上述步骤之后,我在 Centos 5.5 上修复了这个问题没有帮助。

我正在使用Percona 5.5服务器,客户端和Devel软件包。我最终不得不运行以下内容才能让我的 PHP 编译工作(在删除 Percona-shared-compat-5.1 之后(:

cp /usr/lib64/lib{perconaserver,mysql}client.so.18.0.0
cp /usr/lib64/lib{perconaserver,mysql}client.so
cp /usr/lib64/mysql/lib{perconaserver,mysql}client_r.a
cp /usr/lib64/mysql/lib{perconaserver,mysql}client.a
cp /usr/lib64/lib{perconaserver,mysql}client_r.so.18.0.0
cp /usr/lib64/lib{perconaserver,mysql}client_r.so
cp /usr/lib64/lib{perconaserver,mysql}client_r.so.18

我希望这有助于其他尝试在使用Percona时从源代码编译PHP的人。