Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-14-2012, 10:59 AM   PM User | #1
zodehala
Regular Coder

 
Join Date: Dec 2007
Posts: 269
Thanks: 28
Thanked 0 Times in 0 Posts
zodehala can only hope to improve
connection problem to other pc in local

my ip is 192.168.2.231

my codes
PHP Code:
$link mysql_connect("192.168.2.21","root","123456");

if(!
$link){
    echo 
mysql_errno().":"mysql_error();

i m getting following error

Code:
Warning: mysql_connect() [function.mysql-connect]: Host '192.168.2.231' is not allowed to connect to this MySQL server in D:\xampp\htdocs\tekoser\x.php on line 24
1130:Host '192.168.2.231' is not allowed to connect to this MySQL server
zodehala is offline   Reply With Quote
Old 01-14-2012, 02:01 PM   PM User | #2
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,667
Thanks: 45
Thanked 456 Times in 444 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
A quick google of "mysql restrict ip" turned up some interesting comments.

It appears you may need to grant each user the privilege of @<ip>


Linky
__________________
Please don't be rude: Put your php code in [php][/php] tags. It is a sticky topic at the top of the forum and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is online now   Reply With Quote
Old 01-14-2012, 05:04 PM   PM User | #3
12k
New Coder

 
Join Date: Jan 2012
Posts: 29
Thanks: 0
Thanked 6 Times in 6 Posts
12k is an unknown quantity at this point
Yupp, that is correct. There are also other ways, but I don't recommend them as they allow WAN connections to mysql which i strongly discourage.
12k is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:53 PM.


Advertisement
Log in to turn off these ads.