cant access remote mysql server need help

血红的双手。 提交于 2019-12-07 21:17:05

问题


I have a unix server with mysql which I am trying to access from my machine. To clarify, access the mysql server. 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:

  1. Is it a firewall issue?
  2. Accessing as 'root' is being denied?

I am new to mysql.


回答1:


Probably because remote root login is not allowed. You can try this article on how to enable remote root:

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




回答2:


1) check the logs you can see where the logs are by checking the my.cnf file. mysqld.log might be the file name, but where

2) a. 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

ps auxw|grep mysql

you should hopefully have enough diagnostic info at this point to figure it out.




回答3:


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

sudo nano /etc/mysql/my.cnf

find "bind-address" row and comment it.
save config and restart mysql using

sudo /etc/init.d/mysql restart

hope solve problem :)




回答4:


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

but for error 10061 check The Firewall in both machines. Masters PC per say, is the one with the phpmyadmin installation

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. destination ip can also be set on some firewalls.

And if you can, search in your firewall for logs, settings, recent activity, etc... to see what and how you are being blocked.



来源:https://stackoverflow.com/questions/6687933/cant-access-remote-mysql-server-need-help

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!