SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    May 2003
    Location
    UK
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Host is not allowed to connect to this MySQL server

    Ok, recently my hosting provider forgot to tell me that the MySQL database i was using was going to be shut down (how nice of them ) so now i've decided to run the MySQL database locally but I keep receiving this error each time i run my script:

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

    Now i've opened port 3306 on my firewall so that can't be the issue

    Could anyone shed some light on it please?

  2. #2
    Santos L Halper Zenith's Avatar
    Join Date
    May 2002
    Location
    Finland
    Posts
    641
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You haven't probably created an user to MySQL which have access from everywhere. If that's not the case are you sure you had your password and username typed correctly?

  3. #3
    Apache Expert i_like_php's Avatar
    Join Date
    Nov 2001
    Location
    Dallas, Texas
    Posts
    1,342
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    isn't that slow to connect to mysql that from your machine instead of a hosted machine?
    i love php

  4. #4
    SitePoint Member
    Join Date
    May 2003
    Location
    UK
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <QUOTE>
    You haven't probably created an user to MySQL which have access from everywhere.
    </QUOTE>

    And how might i go around doing that?

  5. #5
    Santos L Halper Zenith's Avatar
    Join Date
    May 2002
    Location
    Finland
    Posts
    641
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Always when you connect to MySQL database you have to enter a password and username. First you must have a root user, which can grant priviledges to other users. The point is: when making web applications don't ever connect to a db with root-user. Always create another user with only minimum priviledges needed.
    http://www.mysql.com/doc/en/Adding_users.html

  6. #6
    SitePoint Guru dragonhawk's Avatar
    Join Date
    Apr 2002
    Location
    Melbourne
    Posts
    707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try setting your hostname to 'localhost' instead of '213.171.216.169'

  7. #7
    SitePoint Member
    Join Date
    May 2003
    Location
    Belfast
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also have the problem of not being able to connect to MySQL from another machine on the same network.

    The firewall is Ok but even if I try telnetting to the port I instantly get the Host is not allowed to connect to this MySQL server message.

    Anyone any ideas?

    Thanks

  8. #8
    SitePoint Member
    Join Date
    May 2003
    Location
    UK
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had to change a few user permissions in MySQL to eventually get this to work. you can either do this via cmd line, or if u have phpmyadmin installed you can use that. HTH

  9. #9
    SitePoint Member
    Join Date
    May 2003
    Location
    Belfast
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Plat1num,

    I am quite new to MySQL and PHP. Could you tell me what you had to change.

    Thanks

    Gary


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
  •