HOWTO: Connect to mySQL database?

Web hosting, FTP/database access, mirror services and hosted blogs
Post Reply
jate
Posts: 11
Joined: Sun Oct 02, 2005 10:27 pm

HOWTO: Connect to mySQL database?

Post by jate » Wed Apr 07, 2010 11:45 pm

Hi,

I'm trying to connect to my free mySQL database via PHP script, but can't seem to get the connection working.

My PHP code is something like the below:
$conn = mysql_connect('home.exetel.com.au:3307', 'fwdbdxx', 'password') or die('Could not connect to mySQL server.');

Why is this failing?

Regards,

SysAdmin

Re: HOWTO: Connect to mySQL database?

Post by SysAdmin » Thu Apr 08, 2010 3:43 pm

jate wrote:I'm trying to connect to my free mySQL database via PHP script, but can't seem to get the connection working.

My PHP code is something like the below:
$conn = mysql_connect('home.exetel.com.au:3307', 'fwdbdxx', 'password') or die('Could not connect to mySQL server.');
Your username has a u before the number. Your db name as a d. You're using
the db name as the username.

Andrew

jate
Posts: 11
Joined: Sun Oct 02, 2005 10:27 pm

Re: HOWTO: Connect to mySQL database?

Post by jate » Fri Apr 09, 2010 4:00 pm

thanks Andrew.

Does the host have to be 'localhost' where its only access internally or can it be a URL like home.exetel.com.au:3307.
Are the ports open for this type of external connection?

Regards,

SysAdmin

Re: HOWTO: Connect to mySQL database?

Post by SysAdmin » Fri Apr 09, 2010 4:11 pm

jate wrote:Does the host have to be 'localhost' where its only access internally or can it be a URL like home.exetel.com.au:3307.
localhost only. Default mysql port.
Are the ports open for this type of external connection?
There are none.

Andrew

Post Reply