SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: mysql server can't resolve hostname or ipaddress except localhost

  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql server can't resolve hostname or ipaddress except localhost

    Hi,

    I have installed fedora 6 in my system to act as an intranet and mysql database, network ip config is set to static. I use php to connect mysql. I am wondering why I can't connect mysql using IP address or hostname but It would connect if I set it to localhost. I have assigned an hostname in my server. Version of mysql is 5.0.27.

    Is there a way how I can connect using my IP address or hostname?

    Thanks....

  2. #2
    SitePoint Enthusiast mithra62's Avatar
    Join Date
    Nov 2004
    Location
    Van Nuys
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    port 3306

    do you have port 3306 open on your machine?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I disabled my firewall but it give me the same results.

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I did a command on mysql box: "~]$ mysql -h hostname.domainname -u root -p" and gives me this error:

    ERROR 1130 (00000): Host 'hostname.domainname' is not allowed to connect to this MySQL server.

    Any idea how I could resolve this issu. Thanks

  5. #5
    SitePoint Evangelist ldivinag's Avatar
    Join Date
    Jan 2005
    Location
    N37 33* W122 3*
    Posts
    414
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    did you add a new user to mysql to attach to the machine via ip addy?

    i normally dont use or touch the root account.

    i immediately create a second root level account and give that a wider permission and root is set to localhost...

    then for each DB, i create an account for it with just enough rights.

    try adding a aux account...
    leo d.

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2006
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi ldivinag,

    I did not add any user in mysql database. I use root to access my database. Problem was started when I tried to overwrite records from backup. I checked the logs and no errors were found.

  7. #7
    SitePoint Evangelist ldivinag's Avatar
    Join Date
    Jan 2005
    Location
    N37 33* W122 3*
    Posts
    414
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    root, by default can only connect by localhost.

    not any ip addy or host name...

    well at least for my 5.0.xNT install...
    leo d.

Bookmarks

Posting Permissions

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