简体   繁体   English

无法访问远程 mysql 服务器需要帮助

[英]cant access remote mysql server need help

I have a unix server with mysql which I am trying to access from my machine.我有一个 unix 服务器和 mysql 我试图从我的机器访问。 To clarify, access the mysql server.为了澄清,访问 mysql 服务器。 When I do I get this error.当我这样做时,我会收到此错误。

Connecting to MySQL server 192.168.1.25...
Can't connect to MySQL server on '192.168.1.25' (10061)

Here are my credentials:这是我的凭据:

username: root
port: 3306

The server is running because I am able to remotely login onto the machine (with ip: 192.168.1.25" and then run mysql from root. What do you think is going on:服务器正在运行,因为我能够远程登录机器(使用 ip: 192.168.1.25" 然后从 root 运行 mysql。你认为发生了什么:

  1. Is it a firewall issue?是防火墙问题吗?
  2. Accessing as 'root' is being denied?以“root”身份访问被拒绝?

I am new to mysql.我是 mysql 的新手。

1) check the logs you can see where the logs are by checking the my.cnf file. 1)检查日志,您可以通过检查 my.cnf 文件来查看日志的位置。 mysqld.log might be the file name, but where mysqld.log 可能是文件名,但在哪里

2) a. 2)一个。 see if it's a network issue.看看是不是网络问题。

telnet 192.168.1.25 3306

b.湾。 see if the service is at that port.查看服务是否在该端口。 ssh to the box # from the local host mysql -u root telnet 127.0.0.1 3306 ssh 到盒子# 从本地主机 mysql -u root telnet 127.0.0.1 3306

ps auxw|grep mysql

you should hopefully have enough diagnostic info at this point to figure it out.您现在应该有足够的诊断信息来解决这个问题。

Probably because remote root login is not allowed.可能是因为不允许远程root登录。 You can try this article on how to enable remote root:你可以试试这篇关于如何启用远程root的文章:

http://benrobb.com/2007/01/15/howto-remote-root-access-to-mysql/ http://benrobb.com/2007/01/15/howto-remote-root-access-to-mysql/

i have this problem and fix it by我有这个问题并通过

first you must grant all to user首先,您必须将所有权限授予用户

GRANT ALL PRIVILEGES ON databasename. TO 'user'@'%' IDENTIFIED BY 'password';

then然后

FLUSH PRIVILEGES;

and change the mysql config using并使用更改 mysql 配置

sudo nano /etc/mysql/my.cnf

find " bind-address " row and comment it.找到“ bind-address ”行并评论它。
save config and restart mysql using保存配置并重启 mysql 使用

sudo /etc/init.d/mysql restart

hope solve problem:)希望解决问题:)

The Message (10061) is do to offline severs or firewall blockage If you get -the name of your pc - can not connect, then mysql is rejecting the connection and you will have to create a 'user' in the mysql database mysql , table user using the IP of the remote connection', and restart the database service The Message (10061) is do to offline severs or firewall blockage If you get -the name of your pc - can not connect, then mysql is rejecting the connection and you will have to create a 'user' in the mysql database mysql , table user使用远程连接的IP',重启数据库服务

but for error 10061 check The Firewall in both machines.但对于错误 10061,请检查两台机器中的防火墙。 Masters PC per say, is the one with the phpmyadmin installation Masters PC per say, 是安装了 phpmyadmin 的那台

Allow Destination ip-[the remote] and port 3306 on the Master Machine and Allow source ip-[the masters]/with any port, and check your destination port(3306) too.允许主机上的目标 ip-[远程] 和端口 3306 并允许源 ip-[主机]/任何端口,并检查您的目标端口(3306)。 destination ip can also be set on some firewalls.目标 ip 也可以在某些防火墙上设置。

And if you can, search in your firewall for logs, settings, recent activity, etc... to see what and how you are being blocked.如果可以,请在防火墙中搜索日志、设置、最近的活动等...以查看您被阻止的内容和方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM