Reputation: 236
I am newbie in handling xammp and windows server 2012 r2 and posting question on stackoverflow basically i am totally noob to all this so please forgive me if am posting something wrong.We connected server and local machine on same network using LAN and installed xampp on both server and local machine,local machine is connected to server..i mean when i ping server's ip in local machine i get 0%loss.I am trying to connect to the database on server machine from local machine using xampp.on server's database i used query
grant all privileges on *.* to 'username'@'%' identified by 'password'` ``
/*and on local machine i used*/ $connect = new mysqli("ip of sever", "user", "password", "database",3306);
/* check if server is alive */
if ($connect->ping()) {
printf ("Server is running ok !\n");
} else {
printf ("server is down running localhost for you\n");
$connect = new mysqli("localhostr", "user", "password", "database");
}
I am getting "server is down running localhost for you" i don't know why local machine is not connecting to database on server.I even checked wheather server's port 3306 is opened or not..Please help
Upvotes: 0
Views: 843
Reputation: 236
windows firewall was blocking the connection,turn off the firewall
Upvotes: 1