Solved

Enable MySQL Remote Connections

Posted on 2011-03-08
3
605 Views
Last Modified: 2012-05-11
Hi, How do I enable remote connections on MySQL 5.  Id like the server to accept all connections on the local subnet 10.190.0.1/24  and remote connections made to an ip address, lets say its 86.17.66.238.

Thank you.
 
0
Comment
Question by:frontpedal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 250 total points
ID: 35067831
MySQL connections are based on the users.  Each user can be 'localhost', anyhost '%', or a specific host.  If you want remote access, the most common way to copy the username and password for the localhost user into an anyhost user.  http://dev.mysql.com/doc/refman/5.1/en/adding-users.html  If you are using phpmyadmin, it makes it very easy to create new users with different connections.
0
 
LVL 4

Assisted Solution

by:gizmola
gizmola earned 250 total points
ID: 35074193
You can use use the GRANT option to add network access grants for existing users.   Just specify the grant for whatever databases, along with the new network ie.  someone'@'86.17.66.238.  You can also use the wildcard as DaveBaldwin indicated.

However, there is also a couple of mysql server configuration items that could be effecting things.  First you have to check that skip-networking is not set.  For 5.1 I don't think that's a default anymore, although for years it was turned on, and would basically disable the entire network layer, only allowing connections through the socket on the same machine.

Now the my.cnf often comes with the bind-address set to 127.0.0.1.  If you are happy just to listen for connections on all the nics in the machine, then you would change that to 0.0.0.0 and restart mysql.

So you basically have a 2 step process...getting mysql to listen on a nic that can talk to the network, and then the individual perms for a user.  If you want an added layer of protection, I'd suggest using a firewall rule on the server, that blocks connections to the nic/port combo that matches your external rule.  This is more efficient than waiting on mysql to lookup the user and determine whether or not they should have access from a particular ip or ip range.
0
 

Author Comment

by:frontpedal
ID: 35083691
Thanks guys both pieces of advice proved very useful.  
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Insert values are dynamic 11 68
Mysql Left Join Case 10 114
Combining Queries 7 53
MySQL-Design Help 12 63
Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question