最佳答案
在 PHP 中,每当我尝试连接到数据库时(通过 mysql_connect
)都会收到以下警告
警告: mysql _ connect () : 头和客户端库的次要版本不匹配
在我的 php -i
输出中,在 mysqli 下面列出了以下值
客户端 API 库版本 = > 5.5.24
客户端 API 头版本 = > 5.1.62
我已经尝试更新 php5-mysql 还有 php,但我已经在这两个版本的最新版本。如何更新标题版本,以便不再看到此警告?
剪辑
我的 MySQL 文件都应该更新为最新版本:
$ apt-get install mysql.*5.5
. . .
mysql-client-5.5 is already the newest version.
mysql-server-core-5.5 is already the newest version.
mysql-server-5.5 is already the newest version.
mysql-testsuite-5.5 is already the newest version.
mysql-source-5.5 is already the newest version.
删除旧版本
$ apt-get remove mysql.*5.1
. . .
Package handlersocket-mysql-5.1 is not installed, so not removed
Package mysql-cluster-client-5.1 is not installed, so not removed
Package mysql-cluster-server-5.1 is not installed, so not removed
Package mysql-client-5.1 is not installed, so not removed
Package mysql-client-core-5.1 is not installed, so not removed
Package mysql-server-5.1 is not installed, so not removed
Package mysql-server-core-5.1 is not installed, so not removed
Package mysql-source-5.1 is not installed, so not removed