简体   繁体   English

无法将本地WordPress连接到远程MySQL服务器

[英]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.

相关问题 mysql_connect在远程主机连接上返回“无法通过套接字连接到本地MySQL服务器”? - mysql_connect returning “Can't connect to local MySQL server through socket” on remote host connection? mysql_connect不能代替本地服务器在远程服务器上工作 - mysql_connect can not work in remote server in stead of local server 无法连接到本地 MySQL 服务器 - Can't connect to local MySQL server 警告:mysql_connect():无法连接到本地 MySQL 服务器 - Warning: mysql_connect(): Can't connect to local MySQL server Wordpress中的MYSQL连接问题-无法通过套接字'/var/lib/mysql/mysql.sock'连接到本地MySQL服务器(2) - Issue with MYSQL connection in Wordpress - Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) 无法连接到远程MySQL服务器(改用默认服务器) - Can't connect to remote MySQL server (uses default server instead) 本地服务器无法使用 PHP 连接到远程 postgresql 数据库,但本地终端可以连接 - local server can't connect to remote postgresql database using PHP, but local terminal can connect linux服务器上的“无法通过套接字连接到本地MySQL服务器” - “Can't connect to local MySQL server through socket” on linux server 无法从php连接到远程Mysql服务器 - Can't connect to remote Mysql server from php 我无法通过本地phpmyadmin访问远程mysql服务器 - I can't access remote mysql server via local phpmyadmin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM