Current location: Hot Scripts Forums » Programming Languages » PHP » Error while creating database (Errornumber 2002: "Can't connect to local MySQL server


Error while creating database (Errornumber 2002: "Can't connect to local MySQL server

Reply
  #1 (permalink)  
Old 04-09-04, 03:13 PM
lylesback2 lylesback2 is offline
Wannabe Coder
 
Join Date: Dec 2003
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Error while creating database (Errornumber 2002: "Can't connect to local MySQL server

Code:
  $server = "localhost";   // often localhost
$username = "krystalklear";    // Your MySQL server username
$password = "password";   // Your MySQL server password
$database = "";    // If you fill in nothing database 'members' will be used. If 'members' doesn't exist it will be created.
$DBprefix = "ALS";   // the prefix for the tables in the database (can be left blank)
password isn't really password, but for say

i get this error when viewing this page
http://www.krystalklear.info/login/login.php

Code:
Error while creating database (Errornumber 2002: "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)")
anyone tell me the problem im having :S i cant figure this out
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 04-10-04, 09:58 AM
Stefan's Avatar
Stefan Stefan is offline
Junior Code Guru
 
Join Date: Jun 2003
Location: Utrecht, The Netherlands
Posts: 599
Thanks: 0
Thanked 0 Times in 0 Posts
check with your host if localhost is indeed the database host. there are hosting providers that use seperate database servers, and there are certain control panels (for instance ensim) that require you to use 127.0.0.1 instead of localhost.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 04-10-04, 12:09 PM
lylesback2 lylesback2 is offline
Wannabe Coder
 
Join Date: Dec 2003
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Stefan
check with your host if localhost is indeed the database host. there are hosting providers that use seperate database servers, and there are certain control panels (for instance ensim) that require you to use 127.0.0.1 instead of localhost.
ok thank you, i checked the database section and it gave me
Host name: mysql5.secureserver.net
User namer: krystalklear
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 04-10-04, 08:05 PM
lylesback2 lylesback2 is offline
Wannabe Coder
 
Join Date: Dec 2003
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
i found this page:
https://www.godaddy.com/gdshop/faq/f...=Web%20Hosting
Code:
 QUESTION:
What name servers do I use if I have a GoDaddy.com hosting account?
 
ANSWER:
GoDaddy.com's name servers are: WSC1.JOMAX.NET and WSC2.JOMAX.NET
this still doesn't work :S
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 04-11-04, 02:05 PM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
these are used for DSN thingy !!
don't worry about them, they have nothing to do with MySQL !!
just change the server value into Mysql5.secureserver.net
PHP Code:

$server "Mysql5.secureserver.net";   // often localhost

$username "krystalklear";    // Your MySQL server username
$password "password";   // Your MySQL server password
$database "";    // If you fill in nothing database 'members' will be used. If 'members' doesn't exist it will be created.
$DBprefix "ALS";   // the prefix for the tables in the database (can be left blank) 
I think you will also need a port for this remote connection !
your host can help you more about it ..
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 04-11-04, 02:37 PM
lylesback2 lylesback2 is offline
Wannabe Coder
 
Join Date: Dec 2003
Posts: 119
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by NeverMind
these are used for DSN thingy !!
don't worry about them, they have nothing to do with MySQL !!
just change the server value into Mysql5.secureserver.net
PHP Code:

$server "Mysql5.secureserver.net"// often localhost
$username "krystalklear"// Your MySQL server username
$password "password"// Your MySQL server password
$database ""// If you fill in nothing database 'members' will be used. If 'members' doesn't exist it will be created.
$DBprefix "ALS"// the prefix for the tables in the database (can be left blank) 
I think you will also need a port for this remote connection !
your host can help you more about it ..
thank you, i e-mailed my host twice, but long weekend... so they won't be open this weekend

yes.. i changed it to what is above, and still getting the same error.
i guess i do need a port

this is what my MySQL looks like
http://www.krystalklear.info/login/database.GIF

Last edited by lylesback2; 04-11-04 at 02:48 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Form to update a MySQL database? Scoobler PHP 9 09-04-08 02:41 AM
Can't connect to local MySQL Abdul Script Requests 3 04-02-04 03:35 AM
Can't connect to local MySQL ERROR Abdul PHP 1 03-27-04 03:43 PM


All times are GMT -5. The time now is 11:11 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.