Ad Widget

Collapse

how to connect mysql database from remote site

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tfqzab
    Member
    • Apr 2011
    • 51

    #1

    how to connect mysql database from remote site

    Hello, everyone. I am using zabbix appliance 1.8.4. I want to connect to the mysql database from my computer, not just on the server locally.
    I use Navicat for mysql(a mysql client tool) to connect to server(the server ip 103.103).
    But I receive the error message:
    2003 - Can't connect to MySQL server on '192.168.103.103'(10060)

    the 3306 port is on on the server( I use the netstat command).

    I use the command on the server:
    mysql -h 192.168.103.103 -u root -p
    it shows error:
    ERROR 1130 (HY000): Host '192.168.103.103' is not allowed to connect to this MySQL server

    but when I use
    mysql -h localhost -u root -p
    I connect successfully to mysql.


    Does anyone know how to connect to mysql database remotely? Thanks in advance!
  • JBo
    Senior Member
    • Jan 2011
    • 310

    #2
    Hi,

    Make sure that mysql is not restricted to 127.0.0.1.
    You said that you checked with netstat but didn't show the output
    Code:
    netstat -tlnp | grep mysqld
    should look like:
    Code:
    tcp        0      0 0.0.0.0:3306          0.0.0.0:*               LISTEN
    but not
    Code:
    tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN
    In this case, you can change it with bind-address parameter in my.cnf
    Code:
    bind-address            = 0.0.0.0
    Since connecting to mysql has nothing specific to Zabbix, if you still have problems you could check Mysql documentation or do a quick google search («mysql remote connection» returns more than 25 million results, the answer is probably there )

    Regards,
    JBo

    Comment

    • tfqzab
      Member
      • Apr 2011
      • 51

      #3
      thank you, JBo. I fixed it. The suse firewall did not open the port 3306.

      Comment

      Working...