简体   繁体   English

Cakephp MySQL连接错误与远程数据库

[英]Cakephp mysql connect errors with remote database

Just baked an app and got this on my cake homepage 刚烘焙了一个应用程序,并将其显示在我的蛋糕主页上

Warning (2): mysql_connect() [function.mysql-connect]: Premature end of data (mysqlnd_wireprotocol.c:554) [CORE\\cake\\libs\\model\\datasources\\dbo\\dbo_mysql.php, line 561] 警告(2):mysql_connect()[function.mysql-connect]:数据过早结束(mysqlnd_wireprotocol.c:554)[CORE \\ cake \\ libs \\ model \\ datasources \\ dbo \\ dbo_mysql.php,第561行]

Warning (2): mysql_connect() [function.mysql-connect]: OK packet 1 bytes shorter than expected [CORE\\cake\\libs\\model\\datasources\\dbo\\dbo_mysql.php, line 561] 警告(2):mysql_connect()[function.mysql-connect]:OK数据包比预期的要短1个字节[CORE \\ cake \\ libs \\ model \\ datasources \\ dbo \\ dbo_mysql.php,第561行]

Warning (2): mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. 警告(2):mysql_connect()[function.mysql-connect]:mysqlnd无法使用旧的不安全身份验证连接到MySQL 4.1+。 Please use an administration tool to reset your password with the command SET PASSWORD = PASSWORD('your_existing_password'). 请使用管理工具通过命令SET PASSWORD = PASSWORD('your_existing_password')重置密码。 This will store a new, and more secure, hash value in mysql.user. 这将在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 [CORE\\cake\\libs\\model\\datasources\\dbo\\dbo_mysql.php, line 561] 如果此用户在由PHP 5.2或更早版本执行的其他脚本中使用,则可能需要从my.cnf文件[CORE \\ cake \\ libs \\ model \\ datasources \\ dbo \\ dbo_mysql.php,第561行]中删除old-passwords标志。

Cake is NOT able to connect to the database. Cake无法连接到数据库。

This issue only occurs when connecting to a remote database, connecting to a localhost database gives me no problems. 仅当连接到远程数据库时才出现此问题,连接到本地主机数据库不会给我带来任何问题。

http://dev.mysql.com/doc/refman/5.1/en/old-client.html http://dev.mysql.com/doc/refman/5.1/zh-CN/old-client.html

The database is using an old-style of password hash for the user that mysql_connect is trying to login with. 数据库正在为mysql_connect尝试登录的用户使用旧式的密码哈希。 The mysql driver in php that you are running is incompatible with the old-style of password hash. 您正在运行的php中的mysql驱动程序与旧式的密码哈希不兼容。 As it says, it wants you to regenerate the password using the new-style of hash. 就像它说的那样,它希望您使用新型的哈希值重新生成密码。

This problem isn't really related to cakephp, but rather PDO and its mysql driver. 这个问题与cakephp并没有真正的关系,而是PDO及其mysql驱动程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM