Problem Remote DB connect

Discussion in 'Installation/Configuration' started by S0ft, Dec 3, 2014.

  1. S0ft

    S0ft Member HowtoForge Supporter

    The Perfect Server - Debian Squeeze (Debian 6.0) With BIND & Dovecot [ISPConfig 3]


    vi /etc/mysql/my.cnf
    Code:
    [...]
    # Instead of skip-networking the default is now to listen only on
    # localhost which is more compatible and is not less secure.
    #bind-address           = 127.0.0.1
    [...]


    by testing SMF 2.0.9 (from another IP connecting me to the server IP remote DB)

    Host '185.27.134.67' is not allowed to connect to this MySQL server


    everything works, to the BD in localhost mode, but in remote mode does not work

    Could someone help me please?
     
    Last edited: Dec 3, 2014
  2. srijan

    srijan New Member HowtoForge Supporter

    Check if any IPtables/Firewall rules preventing the communication
     
  3. S0ft

    S0ft Member HowtoForge Supporter

    Iptables -L
    Code:
    Chain INPUT (policy ACCEPT)
    target     prot opt source               destination
    fail2ban-ssh  tcp  --  anywhere             anywhere            multiport dports ssh
    fail2ban-pureftpd  tcp  --  anywhere             anywhere            multiport dports ftp
    fail2ban-dovecot-pop3imap  tcp  --  anywhere             anywhere            multiport dports pop3,pop3s,imap2,imaps
    ACCEPT     all  --  server1.mydomain.com     anywhere
    
    Chain FORWARD (policy ACCEPT)
    target     prot opt source               destination
    
    Chain OUTPUT (policy ACCEPT)
    target     prot opt source               destination
    
    Chain fail2ban-dovecot-pop3imap (1 references)
    target     prot opt source               destination
    RETURN     all  --  anywhere             anywhere
    
    Chain fail2ban-pureftpd (1 references)
    target     prot opt source               destination
    RETURN     all  --  anywhere             anywhere
    
    Chain fail2ban-ssh (1 references)
    target     prot opt source               destination
    RETURN     all  --  anywhere             anywhere
    
    What am I doing wrong?
    What is missing?

    help
     
    Last edited: Dec 3, 2014
  4. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    check the host-permissions for the use in the mysql-database.

    Host '185.27.134.67' is not allowed to connect to this MySQL server

    comes from yur mysql-server and has nothing to do with the firewall.
     
  5. S0ft

    S0ft Member HowtoForge Supporter

    /sbin/iptables -A INPUT -i eth0 -p tcp --destination-port 3306 -j ACCEPT
    /sbin/iptables -A INPUT -i eth0 -s IP -p tcp --destination-port 3306 -j ACCEPT

    Explain to me how to do that?
    I am newbie

    telnet ip 3306
    D♦Host '179.7.84.50' is not allowed to connect to this MySQL server


    help
     
  6. florian030

    florian030 ISPConfig Developer ISPConfig Developer

    please read my post. this has nothing to do with your firewall. you must allow remote-access to the mysql-database for the user.

    mysql -u USER -h HOST -p

    and enter the password.
     
  7. S0ft

    S0ft Member HowtoForge Supporter

    Code:
    root@g1:~# mysql -u root -h [B]IP SERVER[/B] -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 425
    Server version: 5.1.73-1 (Debian)
    
    Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement..
    GRANT ALL PRIVILEGES ON *.* TO root@'%'; FLUSH PRIVILEGES;

    How do you give permission?
    Will all be done manually?
    What for each new user?

    SMF test
    Host '179.7.84.50' is not allowed to connect to this MySQL server

    help
     
    Last edited: Dec 3, 2014
  8. S0ft

    S0ft Member HowtoForge Supporter

Share This Page