[英]Can't connect local WordPress to a remote MySQL server
I have a local WP which I want to connect to a remote database. 我有一个本地WP,我想连接到远程数据库。 Even though my connection parameters in
wp-config.php
are correct, I'm getting 'Error establishing a database connection'. 即使我在
wp-config.php
中的连接参数正确,我仍收到“建立数据库连接时出错”。
With WP_DEBUG
enabled, I see this error message: 启用
WP_DEBUG
,我看到以下错误消息:
Warning: mysqli_real_connect(): (HY000/2049): Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled) in /media/AMPP/nginx-root/projects/lepleco/http/wp-includes/wp-db.php on line 1490
警告:mysqli_real_connect():(HY000 / 2049):在/ media / AMPP / nginx-root / projects / lepleco / http / wp中使用旧(4.1.1之前)身份验证协议的连接被拒绝(启用了客户端选项“ secure_auth”) -includes / wp-db.php 1490行
When I try plain mysql connect from Terminal: 当我尝试从终端连接普通mysql时:
mysql -h [correct-host] -u [correct-username] -p[correct-password] [correct-db-name]
Again I get this error: 我再次收到此错误:
ERROR 2049 (HY000): Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)
错误2049(HY000):使用旧(4.1.1之前)身份验证协议的连接被拒绝(启用了客户端选项“ secure_auth”)
The only way I am able to connect is with the --skip-secure-auth
flag: 我能够连接的唯一方法是使用
--skip-secure-auth
标志:
mysql -h [correct-host] -u [correct-username] -p[correct-password] [correct-db-name] --skip-secure-auth
But for the life of me I can't figure out how to use this for my WordPress connection. 但是对于我的一生,我不知道如何在我的WordPress连接中使用它。
Where am i wrong? 我哪里错了?
Have you tried changing your password? 您是否尝试过更改密码?
According to this dba stackexchange post the fact that you cannot connect is not a bug. 根据此 dba stackexchange帖子,您无法连接的事实不是错误。
I think that if you change your MYSQL password for this user and then try to reconnect you should be alright. 我认为,如果您更改该用户的MYSQL密码,然后尝试重新连接,应该没问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.