简体   繁体   中英

how to access database on windows server 2012 r2 from local machine using xampp?

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

Windows防火墙阻止了连接,请关闭防火墙

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM