local testing server: Unable to connect to your database server | Unable to select the database
Posted: 20 July 2008 03:17 PM   [ Ignore ]  
Summer Student
Avatar
Total Posts:  29
Joined  07-15-2008

This was originally posted in the EE Core forum, but I have since purchased a personal license and encountered the same problems.
original post from EE Core Forum

Okay, I’ve done some pretty extensive reading in the forums without luck fixing this problem. On install I am getting the following errors:

  1. Unable to connect to your database server.
  2. Unable to select the database

I am installing an instance of EE. I am installing 1.6.4 onto the localhost on my HD as a testing environment, so I don’t have a hosting provider to call to check my server settings. Here are the basics of my system:

Mac OS 10.5
MySQL 5.0.45
PHP 5.2.5
Apache 2.0
EE Core 1.6.4

Please note I am currently running an instance of Wordpress on my localhost without error.

I filled out the dbtest.php and received the following response:

Warning: mysql_connect() [function.mysql-connect]: Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (2) in /Library/WebServer/Documents/ee/ebauche/utilities/dbtest.php on line 12

Unable to connect to your database server

Warning: mysql_select_db() [function.mysql-select-db]: Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’ (2) in /Library/WebServer/Documents/ee/ebauche/utilities/dbtest.php on line 28

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /Library/WebServer/Documents/ee/ebauche/utilities/dbtest.php on line 28
Unable to select your database

I have checked and double checked my usernames and passwords without change.
ensured there were no “$” in my passwords
changed databases just in case there was some kind of corruption

What can I try next to get up and running? Thank you for any help you can provide.

 Signature 

Brian Hull
Independent Web Designer
Second Lamppost

Profile
 
 
Posted: 20 July 2008 11:58 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15347
Joined  05-15-2004
secondlamppost - 20 July 2008 03:17 PM

1. Unable to connect to your database server.
2. Unable to select the database

There are issues with your server. Do you have phpMyAdmin installed? Can you access the db fine? It’s almost certainly a server configuration issue. See if this thread is any help.

I have checked and double checked my usernames and passwords without change.

Also check the host and database name.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 21 July 2008 08:40 AM   [ Ignore ]   [ # 2 ]  
Summer Student
Avatar
Total Posts:  29
Joined  07-15-2008

Thanks Ingmar, I have phpMyAdmin installed and running smoothly because that is how I maintain my Wordpress testing environment. I’ll take a look at the post you suggested tonight and see if that solves my problem.

 Signature 

Brian Hull
Independent Web Designer
Second Lamppost

Profile
 
 
Posted: 21 July 2008 07:40 PM   [ Ignore ]   [ # 3 ]  
Summer Student
Avatar
Total Posts:  29
Joined  07-15-2008

Okay, I have gone over Ingmar’s suggested post but no change. Most of the changes suggested in that post seem to already be present on my machine. Unfortunately server side languages are my achilles heel (one of the many reasons I found EE so attractive).

Here’s a quick background on my problem. PHP and MySQL have to be communicating at least with some databases because I am running a Wordpress database on my localhost without error. On initial install of Wordpress it took me over a week to get things running and only got fixed when I hired a MySQL DBA to remote in to fix my connections issues. (The whole process was very easy on my old Mac Powerbook G4 running OS 10.4, but proved to be quite difficult on my new Mac Book Pro running 10.5.) I used the local testing server setup instructions from the books of David Powers.

I ran the server setup wizard to test my compatibility. Attached you will find the response as picture 1.png. I get the error:

can’t connect to local mysql server through socket /var/mysql/mysql.sock

I am attaching a screen grab of that as well.

The screengrab of my php info file is too big to attach. You can find it here.

Any help on how I can get up and running with Expression Engine would be greatly appreciated.

Image Attachments
Picture 1.pngPicture 3.png
Click thumbnail to see full-size image
 Signature 

Brian Hull
Independent Web Designer
Second Lamppost

Profile
 
 
Posted: 22 July 2008 08:32 AM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23521
Joined  05-20-2002

Not my strong point either- but see if this looks helpful.  Why it would be working w/wp and not EE I’m not sure.  But it’s definitely server setup in play.

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 22 July 2008 10:16 AM   [ Ignore ]   [ # 5 ]  
Summer Student
Avatar
Total Posts:  29
Joined  07-15-2008

Thanks for the resource Robin. It didn’t work for me, but I just noticed something while trying it out. The error from wizard.php says:

Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’

But when I browse the hidden files on my HD with BBEdit I can’t find a sub-folder in “var” named “mysql”. I find my “mysql.sock” file in “tmp/mysql.sock”. Is is safe to create a new folder and relocate this file, or is there a way to point EE to the correct mysql.sock location?

Thanks

 Signature 

Brian Hull
Independent Web Designer
Second Lamppost

Profile
 
 
Posted: 22 July 2008 10:24 AM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32855
Joined  05-14-2004

Hi, Brian,

Unfortunately, setting up your server is beyond what we can offer as technical support for ExpressionEngine.  I would highly recommend using a professional hosting account for this, so that they can help you with any troubleshooting on PHP and MySQL connections.

 Signature 
Profile
MSG
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64894 Total Logged-in Users: 55
Total Topics: 81829 Total Anonymous Users: 38
Total Replies: 439922 Total Guests: 283
Total Posts: 521751    
Members ( View Memberlist )