Koozali.org: home of the SME Server

MySQL access denied from local network

Offline kevincallan

  • **
  • 34
  • +0/-0
MySQL access denied from local network
« on: December 04, 2009, 05:42:49 PM »
I am trying to connect to my SME 7.4 box with either MySQL Administor or NavCat.  I followed the instructions (reluctantly) at http://wiki.contribs.org/SME_Server:Documentation:FAQ#Access_MySQL_from_the_local_network to allow access.  (Both tools require port connection it seems so I did the second step as well.)  Did that open my database to the WAN side also?

When I try to connect from the LAN side, I get an error message that states, "Could not connect to the specified instance.  MySQL Error Number 1130.  Host 'pc-00242.mydomain.net' is not allowed to connect to this MySQL server.  If you want to check the network connection, please click the Ping button."

I've browsed the forums and the docu for several hours but have not found anything.  If I have done badly with the mods to the server by opening the port to the WAN, would one of you experts mind to tell me how to undo it?  I figured out how to reverse the first step but not the second.

Thanks.
......

Offline chris burnat

  • *****
  • 1,135
  • +2/-0
    • http://www.burnat.com
Re: MySQL access denied from local network
« Reply #1 on: December 04, 2009, 09:30:06 PM »
Moving to General Discussion where it is more appropriate.
- chris
If it does not work out of the box, please fill in a Bug Report @ Bugzilla (http://bugs.contribs.org)  - check: http://wiki.contribs.org/Bugzilla_Help .  Thanks.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: MySQL access denied from local network
« Reply #2 on: December 05, 2009, 01:51:33 AM »
When I try to connect from the LAN side, I get an error message that states, "Could not connect to the specified instance.  MySQL Error Number 1130.  Host 'pc-00242.mydomain.net' is not allowed to connect to this MySQL server.  If you want to check the network connection, please click the Ping button."
This is most likely a internal MySQL permission error caused by the permissions (ACL) definded in MySQL. You will have to create a user that has privileges to access the database from another host than localhost (perhaps using the wildcard %, %.domain.tld or when really desiring to be strict pc-00242.mydomain.net).
Pointers for this can be found in the MySQL documentation when looking for the GRANT statement as well as in the wiki.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline janet

  • *****
  • 4,812
  • +0/-0
Re: MySQL access denied from local network
« Reply #3 on: December 05, 2009, 02:59:16 PM »
kevincallan

You should always check existing settings before making changes so you know what to revert to.

config show mysqld

To undo remote mysql access
config set mysqld service access private status enabled TCPPort 3306
signal-event remoteaccess-update
signal-event reboot

Also see
http://forums.contribs.org/index.php/topic,38998.msg177735.html#msg177735
and
http://forums.contribs.org/index.php/topic,37973.msg171053.html#msg171053
« Last Edit: December 05, 2009, 03:13:10 PM by mary »
Please search before asking, an answer may already exist.
The Search & other links to useful information are at top of Forum.

Offline mmccarn

  • *
  • 2,651
  • +10/-0
Re: MySQL access denied from local network
« Reply #4 on: December 05, 2009, 05:02:13 PM »
I've added a wiki section about creating database users with appropriate access rights: http://wiki.contribs.org/MySQL#Create_MySQL_user.28s.29_with_access_from_other_computers

Please let us know if these instructions work, or if they need fine tuning.


Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: MySQL access denied from local network
« Reply #5 on: December 05, 2009, 05:41:13 PM »
I've added a wiki section about creating database users with appropriate access rights: http://wiki.contribs.org/MySQL#Create_MySQL_user.28s.29_with_access_from_other_computers

Please let us know if these instructions work, or if they need fine tuning.
I have added a tip to use hostnames in certain cases (like dynamically assigned IP addresses). I personally prefer to assign access restrictions using hostname over IP as IMHO IP addresses change more often than hostnames.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: MySQL access denied from local network
« Reply #6 on: December 05, 2009, 06:39:22 PM »
I have added a tip to use hostnames in certain cases (like dynamically assigned IP addresses). I personally prefer to assign access restrictions using hostname over IP as IMHO IP addresses change more often than hostnames.

That's only a minor reason. The major reason for using IP addresses rather than hostnames is that hostnames can be spoofed by attackers, if they control reverse DNS.

Offline kevincallan

  • **
  • 34
  • +0/-0
Re: MySQL access denied from local network
« Reply #7 on: December 10, 2009, 08:56:32 PM »
It apparently has been a while--my post alerts went to my old email address.  When I requested an email change in my profile, my browser crashed and I couldn't log it.  Just today could I post.  Thank you all for the help.  I will be trying the suggestions and will report back here soon.
......

Offline kevincallan

  • **
  • 34
  • +0/-0
Re: MySQL access denied from local network
« Reply #8 on: December 12, 2009, 07:01:08 PM »
I now have access to the database from the LAN.  Thanks to all of you for your help.  The wiki is a great resource on this topic.

Thanks.  :-)
......