Windows 7 PHP MySQL连接问题
参见英文答案 >
Cannot connect to MySQL 4.1+ using old authentication????????????????????????????????????7个
当我运行$conn = mysql_connect($host,$user,$pass);我能够获得与数据库的连接,但是当我执行var_dump($conn)时,我回到bool(true),这限制了我与多个服务器的多个连接. 这台计算机上的原始设置是XAMPP,其PHP版本通过PHP安装程序升级到PHP 5.3.4.它可以毫无问题地连接到其本地数据库(除了返回布尔值而不是资源链接标识符),但无法连接到任何远程计算机(并且已确认连接到远程计算机的能力).在没有能够提出解决方案的情况下,我升级到了内置PHP 5.3.1的XAMPP版本.在重新安装XAMPP之后我得到完全相同的错误,这让我相信这是一个更大的问题. 编辑1 ** 转到干净的Windows安装并安装XAMPP并尝试运行mysql_connect到远程服务器(PHP 5.3.1)我得到相同的错误: Warning: mysql_connect() [function.mysql-connect]: Premature end of data (mysqlnd_wireprotocol.c:554) in [Removed] on line 2 Warning: mysql_connect() [function.mysql-connect]: OK packet 1 bytes shorter than expected in [Removed]p on line 2 Warning: mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). This will store a new,and more secure,hash value in mysql.user. If this user is used in other scripts executed by PHP 5.2 or earlier you might need to remove the old-passwords flag from your my.cnf file in [Removed] on line 2 解决方法
检查my.cnf文件中的old_passwords选项.
http://dev.mysql.com/doc/refman/5.0/en/server-options.html#option_mysqld_old-passwords 如果由于某种原因您无法切换到新密码,则不能将mysqlnd用作MySQL驱动程序,并且需要切换回较旧的密码. 有关mysqlnd的更多信息 http://dev.mysql.com/downloads/connector/php-mysqlnd/ (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- windows – 使用PowerShell设置DNS
- 权限不会超过1级
- Windows服务触发启动 – 差异手动与自动?
- windows – 在登录之前如何让bginfo清除现有的壁纸?
- windows-7 – Windows 10上的ISCSI性能降低
- 在哪里可以找到Microsoft docx格式的架构(.xsd文件)
- windows-server-2008-r2 – 如何配置Remoteapp服务器以提高
- Win7、Win8、Win10始终以管理员身份运行程序。
- winforms – 拖放如何影响Windows窗体应用程序中的内存使用
- Windows下面startup.bat启动Tomcat偶发死锁问题
- windows-8 – 如何使用javascript取消Windows 8.
- windows-7 – 持续缓慢的域登录/文件夹重定向
- ScrollViewer中的WebView带有XAML元素头
- windows-server-2008 – 无法增加Windows Server
- 在Windows服务中托管WCF服务
- win-universal-app – 桌面应用程序中的UWP限制
- 是否可以编辑已在Windows批处理中输出的行?
- windows下安装php的memcache模块的方法
- 我可以在Windows中开发.NET应用程序并为Linux和M
- windows-server-2008 – 在8 GB RAM机器上删除页