Solved

restrict mysql db access by ip range using remote access

Posted on 2008-06-16
6
1,915 Views
Last Modified: 2010-04-21
HI
I have an ODBC connection to MYQL DB on a hosted server and want to allow a codeveloper make this connection also. However he gets an error refusing access form his IP but I do not know where to make a setting that will permit him. In fact I can't find where the setting is that permits my IP or network to make the conenction.

The firewall is off (temporaririly) so thats not the cause. Any ideas?
0
Comment
Question by:ciaranoco
6 Comments
 
LVL 49

Accepted Solution

by:
Roonaan earned 130 total points
ID: 21794724
When granting permissions you need to set both username and hostname or ip. What tool are you using for your mysql user management?
0
 

Author Comment

by:ciaranoco
ID: 21794771
we are using a single admin user access to the MYSQL DB. When my codeveloper connects from  my network the connection is fine but from his 'open' network (no firewall) he cannot connect.

many thanks
0
 
LVL 77

Assisted Solution

by:arnold
arnold earned 60 total points
ID: 21794909
Get the MYSQL GUI tools at http://dev.mysql.com/downloads/gui-tools/5.0.html.

You might need to contact the host and request that they add his IP/login.

Try the following.  Login into mysql using the command line tool.
run select * from mysql.user where User='username'

What you are looking for is the first column.  If the first column is a specific hostname/Ip or %(any host).  You need to add a user from the remote location you then might also configure DB access. The GUI tool makes it simple, but changes can also be done on the command line.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 2

Assisted Solution

by:raheel_lips
raheel_lips earned 30 total points
ID: 21794985
Are you using php 5 or php 4?
If you are using PHP 5, so try one of the following.

I think you will get rid of your problem.

Regards,
Raheel

1. mysql_connect('localhost:/tmp/mysql.sock', 'user', 'password');
                                OR
2. mysql_connect('your-IP:/tmp/mysql.sock', 'user', 'password');
                                OR
3. mysql_connect('localhost', 'user', 'password');

Open in new window

0
 
LVL 50

Assisted Solution

by:Steve Bink
Steve Bink earned 30 total points
ID: 21795124
The actual instructions for what you want are here:

http://dev.mysql.com/doc/refman/5.1/en/user-account-management.html

Specifically, you'll want to grant usage and other access to 'username'@'w.x.y.z'.  All the GUI front-ends I have seen allow for this in their interface.  You can also use the GRANT commands directly in the MySQL command-line client.
0
 

Author Closing Comment

by:ciaranoco
ID: 31467658
Thanks for your input guys.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Creating and Managing Databases with phpMyAdmin in cPanel.
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…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

830 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