如何将 MySQL 5.x 与 PHP 4.x 一起使用?
我被要求支持遗留系统。为此,我需要在我的计算机上安装 PHP4 以及 MySQL 4.x。我找不到可以在我的计算机上安装的 MySQL 4.x 版本,因此我想将系统升级到 MySQL 5.x。问题是,PHP4 似乎不能与 MySQL 5.x 一起使用。
我在某处读到过,PHP 中需要一个名为 mysqli 的东西才能与 MySQL 5.x 一起工作。我只是不太明白它是 PHP5 中包含的东西还是可以添加到 PHP4 中的东西。
如果我可以将其添加到 PHP4 中,如何添加?
谢谢。
I am requested to support a legacy system. I needed to install PHP4 on my computer for that and also MySQL 4.x. I couldn't find a MySQL 4.x version that installs on my computer so I thought I'd upgrade the system to MySQL 5.x. The problem is, PHP4 does not seem to work with MySQL 5.x.
I've read somewhere that something called mysqli is needed in PHP for it to be able to work with MySQL 5.x. I just couldn't quite understand whether it's something that is included in PHP5 or something I can add to PHP4.
If it's something I can add to PHP4, how?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
PHP4 应该可以很好地与 MySQL 5 配合使用。注意,我只是根据经验进行讨论,有时我在官方 MySQL 和 PHP 网站上读到的技术内容似乎与我观察到的内容相冲突。对于我所做的,我真正需要担心两者之间的兼容性的唯一一件事是身份验证。确保您尝试从 PHP4 连接的 MySQL 帐户使用旧的密码编码。您可以自己在 mySQL 用户表中看到这一点。我不记得确切的数字,但旧格式下存储的密码大约有 16 个散列字符,而新格式下存储的密码要长得多。
更多信息请点击这里:
http://dev.mysql.com/doc/refman/5.5 /en/old-client.html
PHP4 should work mostly fine with MySQL 5. Note I'm just talking from experience, sometimes it seems the technical stuff I read on the official MySQL and PHP sites have conflicted with what I observe. For what I've done, the only thing I really needed to worry about for compatibility between the two is authentication. Make sure the MySQL account you're trying to connect with from PHP4 uses the old password encoding. You can see this yourself in the mySQL user table. I can't remember the exact numbers but passwords stored under the old format are around 16 characters hashed whereas under the new format they are significantly longer.
More info here:
http://dev.mysql.com/doc/refman/5.5/en/old-client.html