Find the answer to your Linux question:
Results 1 to 9 of 9
Hello, I'm still learning linux and had a few questions. I've got a linux server running debian, and its got the newest version of mysql on it. It works fine, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2010
    Posts
    4

    Trying to connect to mysql from an outside computer


    Hello, I'm still learning linux and had a few questions. I've got a linux server running debian, and its got the newest version of mysql on it. It works fine, it lets me connect through Putty from my other computer (I cant work with the actual box, its much easier to work with putty) but when I try to connect with MYSQL-front it gives me the error

    "SQL execution error #1045. response from the database: Access denied for user 'root'(at)'user(at)local')using password: YES) please check the username and password. Afterwards, please ask the database administrator (internet provider) if you are allowed to connect from this computer."

    So since I'm the database admin, I really can't ask myself :P anyone have any ideas to get this working?

    More info: I'm connecting using my LAN IP address for the server box, and I know I'm using the right password for the root mysql account.

  2. #2
    Blackfooted Penguin daark.child's Avatar
    Join Date
    Apr 2006
    Location
    West Yorks
    Posts
    4,393
    Hi and welcome to the forum.

    Did you set a password for root? If not try using 'root' as the username and no password when you login.

  3. #3
    Just Joined! claudiu's Avatar
    Join Date
    Dec 2009
    Location
    Bucharest, Romania
    Posts
    16
    If you are connecting from the actual server use:
    mysql -u root -p
    Don't use the lan IP, on a few distributions mysql is listening only on 127.0.0.1 (that's local host) and it allows only local connections.

    EDIT:

    Hm, the title explains you are connecting from an outside box, then you should edit: /etc/my.cnf

    Here edit/add:

    bind-address=YOUR-IP-ADDRESS
    #skip-networking


    Make sure you replace YOUR-IP-ADDRESS with your actual ip address and comment out skip-networking with a #

    And restart mysql after editing this config file.

  4. #4
    Just Joined!
    Join Date
    Apr 2010
    Posts
    4
    Okay thanks for the info, but one question, when you say my ip do you mean the one for the outside box? I forgot to mention they are on the same network, so I thought it would just work with the LAN Ip address, but I guess not. so my question is which IP would I put there?

    Thanks for all your help!

  5. #5
    Just Joined! claudiu's Avatar
    Join Date
    Dec 2009
    Location
    Bucharest, Romania
    Posts
    16
    You need to bind mysql onto the ip of your server.
    Meaning that you will have to use the ip of the server not the outside box.

  6. #6
    Just Joined!
    Join Date
    Apr 2010
    Posts
    4
    Okay so I did that, but there was nothing that said skip networking (except a note which said "# Instead of skip-networking the default is now to listen only on
    # localhost which is more compatible and is not less secure.") and it still doesn't let me connect, using the same info as before and giving me the same error. Could it be that the account "root" is root@localhost? and when I try to log on it gives me root@(my computers name)@local?

  7. #7
    Just Joined! claudiu's Avatar
    Join Date
    Dec 2009
    Location
    Bucharest, Romania
    Posts
    16
    Run:
    netstat -nlp

    It will list the services listening on all ports, if mysql is listening on 127.0.0.1 then you can not login from an outside box.

    The secure way is to add a new user and allow remote access from only your remote ip address.

  8. #8
    Just Joined!
    Join Date
    Apr 2010
    Posts
    4
    when I ran that command the only thing listed for mysql is " 5976/mysqld
    tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN "

  9. #9
    Just Joined! claudiu's Avatar
    Join Date
    Dec 2009
    Location
    Bucharest, Romania
    Posts
    16
    Paste the content of my.cnf here

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •