You are here: Re: can't connect « PHP Programming Language « IT news, forums, messages
Re: can't connect

Posted by David Haynes on 09/26/16 11:37

Shelly wrote:
> (also posted to alt.php.sql and comp.databases.mysql)
>
> This is an old problem. I extensively researched the postings on the
> internet and have found no solution. So, perhaps someone here can help.
>
> The problem is that from my index.php file I get:
>
> Can't connect to local MySQL server through socket
> '/var/lib/mysql/mysql.sock'
>
> Now, when I do an ls -l '/var/lib/mysql/mysql.sock it shows that the daemon
> is running. It shows it there (size 0, as it should be). Furthermore, I
> can connect from command line and can do mysql commands. The mysql is on
> the same machine as the web server, so I use localhost as the host. php is
> running on the server as well. The ini file shows the default location of
> be empty, so it should default to the installation default of
> /var/lib/mysql/, and it does since it shows up with an ls.
>
> One post suggested changing ownership and group to mysql. I did that, but
> in reality that is how was originally anyhow.
>
> So, I am stumped. Are there any suggestions?
>
> Shelly
>
>
>
I don't know if you've already checked this, but you mention changing
ownership and group but not permissions.

Your web server will be running as a certain user. For example, apache
runs as user 'nobody' unless you change it. Are your permissions open
enough to allow user nobody to use the socket file?

It should probably have full read/write/execute permissions for user,
group and world.

-david-

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация