Code2Design.com

User login

The Layout

Programming

Graphic Design

Resources

Navigation

C2D Projects

Unsystematic Affiliates

Tutorial Mix Photoshop Cafe Tarnic Proof That God Exists 

Change Language

Who's online

There are currently 0 users and 6 guests online.

Cannot connect mysql.sock(2)

Greetings. I have followed your tutorials and my apache and php work. (I run a linux box) mysql is installed as I can see databases. When I want to connect, I get the error (cannor recall the correct format and wording) function mysql_connect unable to connect ..../tmp/mysql.sock

I have tried changing the /etc/my.cnf file settings as mysql.sock is in /var/lib/mysql.sock but when I look at the properties, it shows 0 file size.

Could you possibly assist.

Many thanks and kind regards
Dmitri


Submitted by Dmitri on April 21, 2007 - 3:45am.
printer friendly version

Cannot connect mysql.sock

Can you post the whole error message because I can't help you until I know what it said.

Chances are that you need to go over your mysql_connect code to make sure you have all the fields right etc. Let me know.


Thanks

What I did was create a link ln -s /var/lib/mysql/mysqlsock /tmp/mysql.sock and it solved the problem. Hopefully this will help others who have a similar problem. (Took me a few days to figure it out :) )

Kind regards
Dmitri


chrooted apache

This is a common problem people face on OpenBSD because, by default, apache runs chrooted. You will usually need to re-create the link on boot due to changing inode numbers.


Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <br> <br /> <h3>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use BBCode tags in the text, URLs will be automatically converted to links
More information about formatting options



Like what you see?

Why not add more? C2D is looking for other Christian Web Masters who would like to help write articles for this site. If you have expericance in FLASH, CSS/HTML, PHP/MySQL, PhotoShop/GIMP, Blender, Javascript, or just General Design - our users would love to hear what you have to say. Contact Us

delicious   digg   reddit   magnoliacom   newsvine   furl   google   yahoo   technorati