1. <legend id='RmoKf'><style id='RmoKf'><dir id='RmoKf'><q id='RmoKf'></q></dir></style></legend>

  2. <small id='RmoKf'></small><noframes id='RmoKf'>

  3. <tfoot id='RmoKf'></tfoot>
    <i id='RmoKf'><tr id='RmoKf'><dt id='RmoKf'><q id='RmoKf'><span id='RmoKf'><b id='RmoKf'><form id='RmoKf'><ins id='RmoKf'></ins><ul id='RmoKf'></ul><sub id='RmoKf'></sub></form><legend id='RmoKf'></legend><bdo id='RmoKf'><pre id='RmoKf'><center id='RmoKf'></center></pre></bdo></b><th id='RmoKf'></th></span></q></dt></tr></i><div id='RmoKf'><tfoot id='RmoKf'></tfoot><dl id='RmoKf'><fieldset id='RmoKf'></fieldset></dl></div>

      • <bdo id='RmoKf'></bdo><ul id='RmoKf'></ul>

      启用远程 MySQL 连接:ERROR 1045 (28000): Access denied f

      时间:2023-08-17

      <small id='nz6sU'></small><noframes id='nz6sU'>

      <legend id='nz6sU'><style id='nz6sU'><dir id='nz6sU'><q id='nz6sU'></q></dir></style></legend>
      <tfoot id='nz6sU'></tfoot>
    1. <i id='nz6sU'><tr id='nz6sU'><dt id='nz6sU'><q id='nz6sU'><span id='nz6sU'><b id='nz6sU'><form id='nz6sU'><ins id='nz6sU'></ins><ul id='nz6sU'></ul><sub id='nz6sU'></sub></form><legend id='nz6sU'></legend><bdo id='nz6sU'><pre id='nz6sU'><center id='nz6sU'></center></pre></bdo></b><th id='nz6sU'></th></span></q></dt></tr></i><div id='nz6sU'><tfoot id='nz6sU'></tfoot><dl id='nz6sU'><fieldset id='nz6sU'></fieldset></dl></div>

            <bdo id='nz6sU'></bdo><ul id='nz6sU'></ul>

              <tbody id='nz6sU'></tbody>

                本文介绍了启用远程 MySQL 连接:ERROR 1045 (28000): Access denied for user的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                在 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:

                • 密码包含美元符号
                • 我试图从 Linux shell 进行连接

                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模板网!

                上一篇:MySQL:连接类型的快速细分 下一篇:错误代码:2013.在查询过程中失去与 MySQL 服务器的

                相关文章

                最新文章

                <i id='RKmhf'><tr id='RKmhf'><dt id='RKmhf'><q id='RKmhf'><span id='RKmhf'><b id='RKmhf'><form id='RKmhf'><ins id='RKmhf'></ins><ul id='RKmhf'></ul><sub id='RKmhf'></sub></form><legend id='RKmhf'></legend><bdo id='RKmhf'><pre id='RKmhf'><center id='RKmhf'></center></pre></bdo></b><th id='RKmhf'></th></span></q></dt></tr></i><div id='RKmhf'><tfoot id='RKmhf'></tfoot><dl id='RKmhf'><fieldset id='RKmhf'></fieldset></dl></div>

                <small id='RKmhf'></small><noframes id='RKmhf'>

                  <bdo id='RKmhf'></bdo><ul id='RKmhf'></ul>
                <legend id='RKmhf'><style id='RKmhf'><dir id='RKmhf'><q id='RKmhf'></q></dir></style></legend>
                <tfoot id='RKmhf'></tfoot>