如何远程连接MySQL数据库服务器?

发布于 2024-08-25 02:32:40 字数 338 浏览 2 评论 0原文

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

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

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

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

谢谢。

I am trying to connect to a MySQL database server (remote), but I can't. I am using an user with grant privileges (not root user). The error message is the following:

Can't obtain database list from the server.
Access denied for user 'myuser'@'mypcname' (using password: YES)

"myuser" is an user I created with grant access. This user allows me to connect locally to every database. I am using the same software versions in both hosts: MySQL Server 4.1 (server) and EMS SQL Manager 2005 for MySQL, edition 3.7.0.1 (client).

The point is that I need to connect to the remote server using a different user, not root user. So, how to make the connection?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

凉栀 2024-09-01 02:32:40

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

grant select on dbname.* to myname@mypc;

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

grant select on dbname.* to [email protected];
grant select on dbname.* to [email protected];

You have to make sure that the remote user account matches what the server will see coming in for a connection. For instance:

grant select on dbname.* to myname@mypc;

will not work if mypc is not resolvable on the server via DNS or the hosts file. In this case, you could try either using an IP, or a FQDN:

grant select on dbname.* to [email protected];
grant select on dbname.* to [email protected];
好多鱼好多余 2024-09-01 02:32:40

请查看 connectionstrings.com,看看您是否拥有用于 MySql

Look in connectionstrings.com to see if you have the right connection string used for MySql.

究竟谁懂我的在乎 2024-09-01 02:32:40

确保

  • 您的 MySQL 服务器不仅侦听本地主机,
  • 您的用户还可以从他的位置访问服务器。尝试在 GRANT 命令中使用 'myuser'@'%'。

Make sure

  • that your MySQL server listens not only on localhost
  • your user can access the server from his location. Try 'myuser'@'%' in the GRANT command.
拔了角的鹿 2024-09-01 02:32:40
 //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
 //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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文