Solved

restrict mysql db access by ip range using remote access

Posted on 2008-06-16
6
1,914 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

777 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