Connecting to MySql outside my network

Hi,

How can I connect to a server outside my LAN and host my database there? At the moment I am using localhost but I would like to try connect to a different server to host the db.

Any suggestions?

ANY INFO is greatly appreciated.

Sign up for a service that offers mysql database hosting and use their connection/login details. Pretty much any web hosting (or vps) service will do.

connectionstring.com

Cheers thanks.

I am hosting it on AWS but for some reason my pages only load when I remove my connection to the database from the top of my index.php.

All credentials are correct in the connection.

[php]

$connection = mysqli_connect(“DB_SERVER”,“DB_USER”,“DB_PASS”,“DB_NAME”) or die("Error " . mysqli_error($connection));

define(“DB_SERVER”, “localhost”);
define(“DB_USER”, “");
define(“DB_PASS”, "
”);
define(“DB_NAME”, “****”);

then in index.php file at the top

<?php require_once("includes/connection.php"); ?>

Is this correct for connecting on a host?

[/php]

Got it working. Slight coding error on my behalf.

Thanks.

Sponsor our Newsletter | Privacy Policy | Terms of Service