What to put in MySQL login script?

Status
Not open for further replies.

generonemo53

New Member
Messages
3
Reaction score
0
Points
0
So I have my php script ready
Code:
<?php
$un = "bob234_dbuser";
$database = "bob234_bobsdb";
$pw = "bob123";
$host = "????";
mysql_connect($host,$un,$pw);
?>
I'm not sure if I've done the above correct and what do I put for host?
btw above is fake login details to represent what mine similarly looks like...

Thanks!
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
Host should be localhost; the rest looks okay (other than being fake login credentials :) )

Code:
$host="localhost";
 
Last edited:

generonemo53

New Member
Messages
3
Reaction score
0
Points
0
Host should be localhost; the rest looks okay (other than being fake login credentials :) )

Code:
$host="localhost";

thanks, seems to be working but I keep getting "Lost connection to MySQL server during query" more often than it should. What's causing this?

It doesn't look good because I'll be running a cron job and what if it fails trying to connect to MySQL? How will cron job know the operation failed and try again?
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
That is due to the MySQL server having some issues, is it still happening?
 
Status
Not open for further replies.
Top