mysql Connection errors

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
alx
Posts: 9
Joined: Mon Jun 05, 2006 6:06 pm

mysql Connection errors

Post by alx »

Hello,

I am trying to install cacti on a Mac os X server 10.4.6 box and I am running into an issue connecting to the mysql.sock. Here is what it returns:

Warning: mysql_pconnect(): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (13) in /Library/WebServer/Documents/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 355

I can connect doing a mysql -u cactiuser -p so it isn't the password.

I have the variable set correctly in my php.ini and also my user and pass are fine in the cacti/config.php Anyone have any ideas what might be causing this?

php 4.3.10 and mysql ver 4.1.10a for apple darwin8.0

Thanks in advance
Alex Morken
King Cycle Group
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

php-mysql support is installed and configured within php.ini?
Please serach the forums for the error message, you should find some entries ...
Reinhard
alx
Posts: 9
Joined: Mon Jun 05, 2006 6:06 pm

Post by alx »

Yep...it is configured and it is looking in the right place. For some reason the connection isn't happening. Is there a way to get any better error messages? other then you just can't connect?

Thanks,

Alex
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

More hints: session support must be installed and enabled. Write permissions to the directory holding th esession data for php must be enabled
Reinhard
alx
Posts: 9
Joined: Mon Jun 05, 2006 6:06 pm

Post by alx »

both are set correctly...I am wondering if it has to do with the current versions of mysql and php I am running...??? something to do with how the mysql.sock is handled?

thanks..
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

No more ideas on my side, sorry
Reinhard
alx
Posts: 9
Joined: Mon Jun 05, 2006 6:06 pm

Post by alx »

I think I found the problem - do you know if I need mysqli compiled into PHP for it to work?

I think that is what I have to try next....such a pain in the a** to compile PHP again...blah...
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

You must enabled 'old-passwords' in MySQL and then re-set your cacti password.
alx
Posts: 9
Joined: Mon Jun 05, 2006 6:06 pm

Post by alx »

Hello,

Thanks for the heads up on the old-password tip. I also saw this of yours...
http://forums.cacti.net/about12207-30.html

unfortunately I did all of that and it still puking out the same error... :evil:

do you know anything about mysqli? do I have to enable that in the configure statement of my php build?

thanks,

alx
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

I've never had the need to use mysqli. Doing the 'old password trick' always made it work for me. I'm even using MySQL 5 and PHP 5.12 on newer installations which work fine.
alx
Posts: 9
Joined: Mon Jun 05, 2006 6:06 pm

Post by alx »

yea...this is an extremely frustrating problem. I am wondering if there is a way that I could get a better error message other then just the generic "can't connect" message.

I will have to dig around for utilities and look in the logs and see what I can pick apart and put together. I will post a solution once I find out what the exact problem is.

Thanks for the input.

Alex Morken
King Cycle Group
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

When it comes to mysqli, I remember some topics related to that a few months ago. But I do not remember the outcome. Please search/google for that. AFAIK, the devs did comment on that
Reinhard
alx
Posts: 9
Joined: Mon Jun 05, 2006 6:06 pm

Post by alx »

I figured out what it was...I couldn't set the hostname to 'localhost', I had to use '127.0.0.1'.

I think I have actually run across this before with other apps and it totally slipped my mind...

thanks for the input!

-Alex Morken
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests