【问题标题】:How to make a remote connection to a MySQL Database Server?如何与 MySQL 数据库服务器建立远程连接?
【发布时间】:2011-01-26 20:57:57
【问题描述】:

我正在尝试连接到 MySQL 数据库服务器(远程),但我不能。我正在使用具有授予权限的用户(不是 root 用户)。错误信息如下:

无法从服务器获取数据库列表。 用户 'myuser'@'mypcname' 的访问被拒绝(使用密码:YES)

“myuser”是我创建的具有授予访问权限的用户。该用户允许我在本地连接到每个数据库。我在两台主机上使用相同的软件版本:MySQL Server 4.1(服务器)和 EMS SQL Manager 2005 for MySQL,版本 3.7.0.1(客户端)。

关键是我需要使用不同的用户连接到远程服务器,而不是 root 用户。那么,如何建立连接呢?

谢谢。

【问题讨论】:

    标签: mysql connection


    【解决方案1】:

    查看connectionstrings.com,看看您是否有用于MySql 的正确连接字符串。

    【讨论】:

      【解决方案2】:

      确定

      • 您的 MySQL 服务器不仅在 localhost 上侦听
      • 您的用户可以从他的位置访问服务器。在 GRANT 命令中尝试 'myuser'@'%'。

      【讨论】:

        【解决方案3】:

        您必须确保远程用户帐户与服务器将要连接的帐户匹配。例如:

        grant select on dbname.* to myname@mypc;
        

        如果mypc 无法通过 DNS 或主机文件在服务器上解析,则将无法工作。在这种情况下,您可以尝试使用 IP 或 FQDN:

        grant select on dbname.* to myname@10.1.2.3;
        grant select on dbname.* to myname@mypc.example.com;
        

        【讨论】:

          【解决方案4】:
           //EMS manager for mysql
           //this magnificient tool provide you with a way to connect to such a server that prevents access to the server from any remote file or any way from outside world
           //all you need is to have ftp access to the remote server
           //in c:/program files/Ems/  you will find file called emsproxy.php
           //it is what we call An (API) in programming world
           //upload that file to your remote server
           //then when you connect with EMS you select tunnling -->checkbox
           //it will ask you on the next step to provide a full url of your emsproxy.php
           //i tested that process myself. i did not have access to cpanel nieghter phpmyadmin
           //thanks
          

          【讨论】:

            猜你喜欢
            • 2022-01-12
            • 1970-01-01
            • 2016-05-25
            • 2017-03-08
            • 1970-01-01
            • 1970-01-01
            • 2015-09-25
            • 2021-01-08
            • 2016-08-04
            相关资源
            最近更新 更多