在 Windows XP 上运行的 MySQL 5.1.31.
MySQL 5.1.31 running on Windows XP.
从 本地 MySQL 服务器 (192.168.233.142) 我可以以 root 身份连接,如下所示:
From the local MySQL server (192.168.233.142) I can connect as root as follows:
>mysql --host=192.168.233.142 --user=root --password=redacted
从远程机器(192.168.233.163),我可以看到mysql端口是开放的:
From a remote machine (192.168.233.163), I can see that the mysql port is open:
# telnet 192.168.233.142 3306
Trying 192.168.233.142...
Connected to 192.168.233.142 (192.168.233.142).
但是当我尝试从 远程 机器连接到 mysql 时,我收到:
But when trying to connect to mysql from the remote machine, I receive:
# mysql --host=192.168.233.142 --user=root --password=redacted
ERROR 1045 (28000): Access denied for user 'root'@'192.168.233.163' (using password: YES)
我在 mysql.user 中只有 2 个条目:
I have only 2 entries in mysql.user:
Host User Password
--------------------------------------
localhost root *blahblahblah
% root [same as above]
我还需要做什么才能启用远程访问?
What more do I need to do to enable remote access?
编辑
正如下面 Paulo 所建议的,我尝试将 % 的 mysql.user 条目替换为特定于 IP 的条目,因此我的用户表现在如下所示:
As suggested by Paulo below, I tried replacing the mysql.user entry for % with an IP specific entry, so my user table now looks like this:
Host User Password
------------------------------------------
localhost root *blahblahblah
192.168.233.163 root [same as above]
然后我重新启动了机器,但问题仍然存在.
I then restarted the machine, but the problem persists.
Paulo 的帮助引导我找到解决方案.它是以下内容的组合:
Paulo's help lead me to the solution. It was a combination of the following:
bash shell 将美元符号视为 扩展 到环境变量,所以我们需要用反斜杠转义它.顺便说一下,如果美元符号是密码的最后一个字符,我们不必这样做.
The bash shell treats the dollar sign as a special character for expansion to an environment variable, so we need to escape it with a backslash. Incidentally, we don't have to do this in the case where the dollar sign is the final character of the password.
举个例子,如果你的密码是pas$word",从Linux bash我们必须按如下方式连接:
As an example, if your password is "pas$word", from Linux bash we must connect as follows:
# mysql --host=192.168.233.142 --user=root --password=pas\$word
这篇关于启用远程 MySQL 连接:ERROR 1045 (28000): Access denied for user的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何有效地使用窗口函数根据 N 个先前值来决定How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函数根据
在“GROUP BY"中重用选择表达式的结果;条款reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用选择表达式的结果;条款?)
Pyspark DataFrameWriter jdbc 函数的 ignore 选项是忽略整Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函数的 ig
使用 INSERT INTO table ON DUPLICATE KEY 时出错,使用 Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 时出错,使用 for 循环数组
pyspark mysql jdbc load 调用 o23.load 时发生错误 没有合pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 调用 o23.load 时发生错误 没有合适的
如何将 Apache Spark 与 MySQL 集成以将数据库表作为How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何将 Apache Spark 与 MySQL 集成以将数据库表作为