Sorry, but I have been searching forums for a while and can't find the answer.
Currently my site is with Streamline.net and I connect to MySQL as follows:
<?php
// Connect to MySQL database
function makeXDBConnection() {
$link = mysql_connect('mysql19.streamline.net', 'dbname', 'p/w')
or die("Couldn't connect to Server.");
mysql_select_db('dbname') or die("Couldn't open database");
}
?>
So what do I use as the first parameter for my MySQL database here at WHUK?
I assume dbname will be the name I created for the database and also the p/w that I created.
In order to establish remote connection to the database, it is very important to grant the access to the IP of the machine from which database will be accessed.
This can be done by adding the IP in cPanel >> Databases >> Remote Mysql >> Remote Database Access Hosts >> Add Access Host .
You can post support ticket or initiate live chat for further assistance.
In order to establish remote connection to the database, it is very important to grant the access to the IP of the machine from which database will be accessed.
This can be done by adding the IP in cPanel >> Databases >> Remote Mysql >> Remote Database Access Hosts >> Add Access Host .
You can post support ticket or initiate live chat for further assistance.
Thanks,
Yes, I indicated in the last sentance of my query that that will be done, so that isn't the problem - it's the php coding that I'm unsure about as stated previously.
I have created a Ticket: TOJ-741-94608 on your behalf and escalated it to the respective dept. Our admins will check the issue and update the same ticket shortly.
Well there was a very simple answer to my question.
By trial and error I discovered that the first parameter in the php command mysql_connect('', '', ''), i.e. the MySQL server is
'localhost'
or if accessing remotely, which was my question, it is simply your domain name. i.e.
<?
mysql_connect('xxxxxxx.xxx','yourdbname','yourpass word')
?>
where xxxxxxx.xxx is your domain name.
One of our support admin has provided all the required information while replying Ticket: TOJ-741-94608. You didn't update the ticket after his reply. Few minutes back, he once again updated the same ticket. Please check the url's mentioned in the email and reply to the same ticket if you need further assistance.