0

Good day everyone Not sure if this is the right place to ask this but im trying to connect to my database online "Control Panel of my hosting site" from my local machine basically the webpage is running locally. but i want the data to be fetch online. my question is do i need to configure my CP? if yes what do i need to change?

heres the config That im working with

        $mysql_hostname="***.***.*.***"; // IP ADD OF MY CP i also tried the webaddress
        $mysql_database="****";
        $mysql_user="****";
        $mysql_password="***";

        $con = mysqli_connect($mysql_hostname,$mysql_user, $mysql_password, $mysql_database);
        mysqli_select_db($con,"svcseuro_nwh")or die(mysql_error());
        date_default_timezone_set('Asia/Manila');

the original config on localhost is

    $mysql_hostname="localhost";
    $mysql_database="nwh";
    $mysql_user="nwh";
    $mysql_password="password";

    $con = mysqli_connect($mysql_hostname,$mysql_user, $mysql_password, $mysql_database);
    mysqli_select_db($con,"svcseuro_nwh")or die(mysql_error());
    date_default_timezone_set('Asia/Manila');

thanks neil

2
Contributors
2
Replies
18
Views
3 Years
Discussion Span
Last Post by ehpratah
0

If your host allows remote MySQL, you'll have to add your local server's IP to their remote MySQL settings to their firewall allows the access. If you're host uses cPanel just look for the remote MySQL icon in the Database Tools section.

0

unfortunately remote mysql is not available on my Cpanel. i just ask my provider to whitelist and allow my ip so i can connect to mysql data.

Edited by ehpratah: typo

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.