Solved

Enable MySQL Remote Connections

Posted on 2011-03-08
3
574 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
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API (https://www.maxmind.com/en/geolite2-developer-package). …
This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

896 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now