PHP中的Mysql密码错误
当我尝试从本地主机连接远程mysql服务器时,出现以下错误:PHP中的Mysql密码错误,php,mysql,xampp,Php,Mysql,Xampp,当我尝试从本地主机连接远程mysql服务器时,出现以下错误: Could not 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').
Could not 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
知道为什么会出现这个错误吗?之所以会出现这个错误,是因为MySQL服务器使用了旧的密码存储方式,而不是新的更安全的方式 php5.3中引入的mysqlnd驱动程序不支持旧的身份验证方式 因此,您必须修改您的MySQL配置,以使用新的、更安全的方式。
您收到的错误消息指示您如何执行此操作。它会出现此错误,因为您的MySQL服务器使用的是旧的密码存储方式,而不是更安全的新方式 php5.3中引入的mysqlnd驱动程序不支持旧的身份验证方式 因此,您必须修改您的MySQL配置,以使用新的、更安全的方式。
您收到的错误消息指示您如何执行此操作。运行PHP时这似乎是个问题运行PHP时这似乎是个问题这对我很有帮助 快速修复 作为数据库用户
SET SESSION old_passwords=0;
SET PASSWORD=PASSWORD('my_password');
SET PASSWORD=PASSWORD('my_password');
作为管理员
FLUSH PRIVILEGES;
FLUSH PRIVILEGES;
真正的修复
打开my.conf文件并注释掉以下行
old_passwords=1
重新启动MySQL。这将确保MySQL不再使用旧密码
作为数据库用户
SET SESSION old_passwords=0;
SET PASSWORD=PASSWORD('my_password');
SET PASSWORD=PASSWORD('my_password');
作为管理员
FLUSH PRIVILEGES;
FLUSH PRIVILEGES;
这对我有帮助
快速修复
作为数据库用户
SET SESSION old_passwords=0;
SET PASSWORD=PASSWORD('my_password');
SET PASSWORD=PASSWORD('my_password');
作为管理员
FLUSH PRIVILEGES;
FLUSH PRIVILEGES;
真正的修复
打开my.conf文件并注释掉以下行
old_passwords=1
重新启动MySQL。这将确保MySQL不再使用旧密码
作为数据库用户
SET SESSION old_passwords=0;
SET PASSWORD=PASSWORD('my_password');
SET PASSWORD=PASSWORD('my_password');
作为管理员
FLUSH PRIVILEGES;
FLUSH PRIVILEGES;
相关问题:相关问题: