SMF Support > Install and Upgrade Help

Error -- " Cannot connect to database server with given data!" FIXED

<< < (4/4)

punt:
Thanks for all your patience with this.

I did as suggested and along with the previous error, I now get

"Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)"

Which comes right before the " Cannot connect to database server with given data!

Please check the information you provided, and then try again."

It's odd 'cause I _can_ connect using the same password and user through the console.

I'm baffled. Hope you're not :)

Thanks again,

-punt

[Unknown]:
Sounds like the way you have set up MySQL is not allowing PHP to connect to it...

I'm not expert on Linux, sorry.

-[Unknown]

punt:
I couldn't ask for more help than you gave me already, so thanks :)

Though just as a side note, I did create a mysql_connect.php file as suggested in your tutorial with the following:

--- Code: ---<?php
 mysql_connect(&#39;localhost&#39;, &#39;smf&#39;, &#39;password&#39;);
 mysql_select_db(&#39;test&#39;);

 echo &#39;Unless you see any error messages, everything should be fine.&#39;;
?>

--- End code ---

Loaded it on the server, and it connected fine, with just the "Unless you see any error messages, everything should be fine" line. So it would seem that linux is working fine with MySQL connections through PHP.

But again, thanks for all the help. Any Linux Guru's out there that might know what's going on??

-punt

punt:
Thanks to all who helped.

I found the answer to my problem. Apparently my install of mysql had its local pesudo filesystem socket in an unexpected location. I symlinked the file with:

--- Code: ---ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
--- End code ---
...and all was good with the world.

Thanks a ton for the help!!!  :D

Navigation

[0] Message Index

[*] Previous page

Go to full version