cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution
Getting Started

Connecting to a Remote MySQL Database

Scenario: I have software running on my PC, Unicenta oPOS (Point of Sale). It is using a MySQL database.

 

I am using the Magento E-commerce software on my website, which will also work off of a MySQL database. I have a plugin for Magento called ASULPUNTO that will remotely connect to a database and sync my online store to my local POS software, allowing me to keep both my local sales and my online sales managed in one database and track inventory, etc.

 

However, the website refuses to connect to the database. I know it is open and the ports are correctly forwarded, as I can connect to it from my home PC using MySQL Workbench with no issues.

Here is all of the configuration the website software allows me to enter (I have made it generic, but this is the formatting I am using... should I format the host name some other way???):

 

Hostname: 123.456.78.90:3306
Database Name: unicenta

Database Login:unicenta

Database Pass: ************

 

There are no other options here. Perhaps there are some other things I need to do in order to allow my GoDaddy hosting to connect to a remote database? Perhaps I am formatting the Hostname wrong (I entered it the same way on MySQL Workbench, does it fix it behind the scenes?)....

Any and all advise would be awesome. This is the last major step to make things work together... I put a lot of time into updating my database from Apache to MySQL and all the ground work for this setup... Kinda bummed that it's not working!

 

Thanks in advance!

1 ACCEPTED SOLUTION


@speed_daemonwrote:

I have created a database using the database Wizard and added the users with all credentials, when I try to get a connection to my database it fails my domain is swaziprocurement.com and I have a single page for now swaziprocurement.com/connect.php but I am failing to connect to my database when I test this connection.

Here is my code:

<?php
$db_name="mbuso81";
$db_user="redsey";
$db_pass="redsey";
$db_host="swaziprocurement.com";
$conn=mysqli_connect("swaziprocurement.com","redsey","redsey","mbuso81");
if (!$conn){

echo "Fail!";
}
else {

echo "Success!";
}
?>

I have a connection to a database that I just created using the wizard but I cant seem to connect to it when I test the connection using PHP


Hi @speed_daemon,
While normally we do not provide support to code, your answer seems to potentially have the wrong host information. If the database is hosted on the same service most people can use
$db_host="localhost";

Best regards,

Michael A. - GoDaddy | Employee
24/7 support available at x.co/247support

View solution in original post

21 REPLIES 21


@speed_daemonwrote:

I have created a database using the database Wizard and added the users with all credentials, when I try to get a connection to my database it fails my domain is swaziprocurement.com and I have a single page for now swaziprocurement.com/connect.php but I am failing to connect to my database when I test this connection.

Here is my code:

<?php
$db_name="mbuso81";
$db_user="redsey";
$db_pass="redsey";
$db_host="swaziprocurement.com";
$conn=mysqli_connect("swaziprocurement.com","redsey","redsey","mbuso81");
if (!$conn){

echo "Fail!";
}
else {

echo "Success!";
}
?>

I have a connection to a database that I just created using the wizard but I cant seem to connect to it when I test the connection using PHP


Hi @speed_daemon,
While normally we do not provide support to code, your answer seems to potentially have the wrong host information. If the database is hosted on the same service most people can use
$db_host="localhost";

Best regards,

Michael A. - GoDaddy | Employee
24/7 support available at x.co/247support

View solution in original post