Click here to Skip to main content
15,029,010 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
hello,
i need to connect a mysql database which is on a remote PC using PHP or smt like that
both PC are connected to internet
i use xampp and win7

i know that i will use
mysql_connect("remote PC's IP", "login name set up for my PC", "login password");

additionally, remote PC should give permission to me to read and write its mysql database.
i did this:

CREATE USER 'remote'@'%' IDENTIFIED BY '***';

GRANT ALL PRIVILEGES ON * . * TO 'remote'@'%' IDENTIFIED BY '***' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

CREATE DATABASE IF NOT EXISTS `remote` ;

GRANT ALL PRIVILEGES ON `remote` . * TO 'remote'@'%';

but it was not fixed. mysql_connect("remote PC's IP", "login name set up for my PC", "login password") gives error:

Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to MySQL server on '79.***.***.***' (10060) in C:\xampp\htdocs\baglan.php on line 3
Can't connect to MySQL server on '79.***.***.*** (10060)

could you please help me about this issue


hello again

i did what you said but no luck...
in my database i have a privilege as

User Host Password Global privileges Grant
mustafa % some pswd all privileges yes

and i add an inbound rule to windows firewall for port 10060 and 3306

any advice...
Posted
Updated 30-Mar-11 0:07am
v7
Comments
Wendelius 29-Mar-11 15:03pm
   
And the error is?
mstftrn 29-Mar-11 15:08pm
   
oh sorry, error: Warning: mysql_pconnect() [function.mysql-pconnect]: Can't connect to MySQL server on '79.***.***.***' (10060) in C:\xampp\htdocs\baglan.php on line 3 Can't connect to MySQL server on '79.***.***.***' (10060)

1 solution

The first thing to check is that the port 10060 isn't blocked by a firewall.
   
Comments
mstftrn 29-Mar-11 15:22pm
   
could you tell me how to give a firewall permission for such a command.
Wendelius 29-Mar-11 15:30pm
   
You have to check firewall settings. For example in Windows open Control Panel, locate the firewall settings and allow traffic using port 10060. You could also try using port 3306 which is the standard port.
mstftrn 29-Mar-11 15:43pm
   
ok i will try and inform you
thanks
Wendelius 29-Mar-11 15:46pm
   
Ok, good luck!
mstftrn 30-Mar-11 6:03am
   
hello
i improved my question
could you please glance at that
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900