Can't connect to MySQL server on '127.0.0.1' (4) on line 6

Status
Not open for further replies.

cybert97

New Member
Messages
9
Reaction score
0
Points
0
Why is this happening, it has been working fine for the last 2 months... But now I get this error all of a sudden :S
Help me?

Full error code:
PHP:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '127.0.0.1' (4) in /home/cybert97/public_html/scripts/connectionfile.php on line 6
Can't Connect To Database: Can't connect to MySQL server on '127.0.0.1' (4)

Next, my connectionfile source:
PHP:
<?php$database_username = "cybert97_admin";$database_password = "123";
//Opens connection to mysql server$dbc = mysql_connect("127.0.0.1", $database_username, $database_password);
if(!$dbc){  die("Can't Connect To Database: ".mysql_error());}
//Select database$db_selected = mysql_select_db("cybert97_users", $dbc);
if(!$db_selected){  die("Can't Connect To Database: ".mysql_error());}?>
Obviously the password isn't the same as the one in the snippet above, anyway, can anyone help me?
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Use "localhost" instead of "127.0.0.1"
 

cybert97

New Member
Messages
9
Reaction score
0
Points
0
That's what I had it at before... And it still didn't work :/
Also basically 90% of the time (only just started happening) I can't connect to my website panel/ftp etc...
Anything else?
 
Last edited:

miceandd

New Member
Messages
7
Reaction score
0
Points
0
Hey,

When you login to cPanel what address does it show in the URL?

Something like this:

//vox.x10hosting.com:2083/login/


On a side note, localhost should work fine. Try changing the "127.0.0.1" to localhost and re run. Post any error that pops up. If its not working then there's something wrong with the rest of the code.
 

cybert97

New Member
Messages
9
Reaction score
0
Points
0
Yes, it's connecting to https://vox.x10hosting.com:2083/..........

Error when using localhost:
Well... I can't even get that now, my page barely even loads, can someone reset my entire account? I have all the files 100% backed-up, my ftp doesn't hardly work either, sometimes it loads and sometimes it doesn't :/

I get this:
HTML:
This webpage is not available
SRWare Iron could not load the webpage because domain took too long to respond. The website may be down, or you may be experiencing issues with your Internet connection.
Here are some suggestions:
Reload this webpage later.
Check your Internet connection. Restart any router, modem, or other network devices you may be using.
Add SRWare Iron as a permitted program in your firewall's or antivirus software's settings. If it is already a permitted program, try deleting it from the list of permitted programs and adding it again.
If you use a proxy server, check your proxy settings or contact your network administrator to make sure the proxy server is working. If you don't believe you should be using a proxy server, adjust your proxy settings: Go to the wrench menu > Settings > Show advanced settings... > Change proxy settings... > LAN Settings and deselect the "Use a proxy server for your LAN" checkbox.
Error 118 (net::ERR_CONNECTION_TIMED_OUT): The operation timed out.
 
Last edited:

miceandd

New Member
Messages
7
Reaction score
0
Points
0
Your account doesn't need resetting. there's some issues on the VOX server (at the start of the URL you posted).

Just a case of waiting until its sorted and then trying again :)
 

cybert97

New Member
Messages
9
Reaction score
0
Points
0
Ok, my site's now working correctly! thanks, you can close the thread now :)
 
Status
Not open for further replies.
Top