您的 PHP MySQL 库版本与您的 MySQL 服务器版本不同
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2357909/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Your PHP MySQL library version differs from your MySQL server version
提问by pako
I've recently upgraded MySQL on my Debian 5.0.4 server to 5.1. Now phpMyAdmin shows the following warning:
我最近将 Debian 5.0.4 服务器上的 MySQL 升级到 5.1。现在 phpMyAdmin 显示以下警告:
Your PHP MySQL library version 5.0.51a differs from your MySQL server version 5.1.43
Your PHP MySQL library version 5.0.51a differs from your MySQL server version 5.1.43
Is it likely to cause any problems?
它可能会导致任何问题吗?
回答by Pascal MARTIN
The message indicates that :
该消息表明:
- You are using version 5.1.43 of MySQL server
- But that the library that's used by PHPto communicate with that server has been compiled to communicate with a version 5.0.xof MySQL.
- 您正在使用MySQL 服务器的 5.1.43 版本
- 但是PHP用来与该服务器通信的库已经被编译为与MySQL 5.0.x 版进行通信。
In theory, this should not cause any real problem: minor versions tend to be compatible ; but you might need to update the library that's used by PHP ; maybe some package like "libmysql", or something like that (I don't have a Debian machine)
理论上,这不会造成任何实际问题:小版本往往是兼容的;但您可能需要更新 PHP 使用的库;也许是一些像“ libmysql”这样的包,或者类似的东西(我没有 Debian 机器)
If you want to make that warning disappear (even if I'm not sure it could really cause any big problem), you'll have to update the PHP componentthat is used to communicate with MySQL.
Note : With the dependancies, it might not be that easy, actually, to upgrade just one package...
如果您想让该警告消失(即使我不确定它是否真的会导致任何大问题),您必须更新用于与 MySQL 通信的 PHP 组件。
注意:对于依赖项,实际上,仅升级一个包可能并不那么容易......
I would say that you'd have to update something like php5-mysql; which means :
我会说你必须更新类似的东西php5-mysql;意思是 :
apt-get install php5-mysql
(According to this page-- amongst others -- to update a single package, your must use install)
(根据此页面- 其中包括 - 要更新单个软件包,您必须使用install)
If you are using aptitude, and not apt-get... Not sure about the right option that you should use to update only one package ; still, aptitude safe-upgradeshould present you with a list of packages it will upgrade, which will allow you to decide whether or not you wish to continue...
如果您使用的是aptitude,而不是 apt-get... 不确定您应该使用哪个正确的选项来更新一个包;仍然,aptitude safe-upgrade应该向您显示它将升级的软件包列表,这将允许您决定是否要继续...
But you said in a comment to another answer that Debian ships by default with MySQL 5.0 -- which means the "official" module for PHP is probably compiled against libmysql 5.0, and not libmysql 5.1.
但是您在对另一个答案的评论中说 Debian 默认随 MySQL 5.0 一起提供——这意味着 PHP 的“官方”模块可能是针对 libmysql 5.0 而不是 libmysql 5.1 编译的。
To solve that problem, you'll have to either :
要解决该问题,您必须:
- Find a repository that provides PHP (or, at least, the
mysqlextension)compiled against libmysql 5.1 - Or re-compilePHP and/or the
mysqlextension against the version of libmysql that's currently used on your system -- i.e. libmysql 5.1
- 找到一个提供针对 libmysql 5.1 编译的PHP (或至少是
mysql扩展)的存储库 - 或者根据系统上当前使用的 libmysql 版本重新编译PHP 和/或
mysql扩展——即 libmysql 5.1
回答by Mark C
Try running sudo apt-get update mysql-client.
尝试运行sudo apt-get update mysql-client。
回答by DropHit
I was seeing this in the phpMyAdmin console - I run Debian 8 on Google cloud and recently upgraded to mysql 5.7.21. I had to run the PHP NativeDriver to get this to subside
我在 phpMyAdmin 控制台中看到了这一点 - 我在谷歌云上运行 Debian 8,最近升级到 mysql 5.7.21。我必须运行 PHP NativeDriver 才能让它消退
sudo apt-get update
sudo apt-get install php5-mysqlnd
回答by iaksit
In Debian/Ubuntu you can overcome that notification by using the following command in the latest repository defined in /etc/apt/sources.list.
在 Debian/Ubuntu 中,您可以通过在/etc/apt/sources.list.
sudo apt-get upgrade mysql-client
That will solve your problem perfectly.
这将完美地解决您的问题。
Have a great day.
祝你有美好的一天。
回答by Chris Ridenour
sudo apt-get update php5-mysql

