By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,491 Members | 3,230 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,491 IT Pros & Developers. It's quick & easy.

MySQL-error : can't connect to local mysql server through socket

P: n/a
On a freshly installed Fedora C3 (incl. webserver apache php mysql) i get
the following problem when connecting to mysql through a browser
(phpMyAdmin):
:
#2002 Can't connect to local MySQL server through socket
/var/lib/mysql/mysql.sock

On the website of MySQL this error is mentioned but I found no solution.

In /var/log/messages the following log occurs :
localhost kernel: audit(....): avc: denied {write}for pid=2458
exe=/usr/sbin/httpd name=mysql.sock dev=hda13 ...

What I have tried :
- mysql.sock is srwxrwxrwx, seems ok, but dont know what the s stands for
- the dir /var/lib/mysql was drwxr-xr-x and I changed it to drwxrwxrwx : no
effect
- tried different version of phpMyAdmin : same error
- installed my website and got the following error : No connection possible
with database (in the next version I will improve the error-messages)
- through commandline there is no problem in connecting to mysql (log in,
create databases, inserts, deletes, uploading dumps, making dumps, ....)

What is the solution or what else can I try ?

thanx,

Pugi!

Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Pugi! wrote:
On a freshly installed Fedora C3 (incl. webserver apache php mysql) i get
the following problem when connecting to mysql through a browser
(phpMyAdmin):
:
#2002 Can't connect to local MySQL server through socket
/var/lib/mysql/mysql.sock


This kind of messages are common when people haven't started the mysql server.

chkconfig --level 35 mysqld on
/etc/init.d/mysqld start
//Aho
Jul 20 '05 #2

P: n/a
The correct answer was : adjust settings SELinux for httpd/apache.
"J.O. Aho" <us**@example.net> schreef in bericht
news:30*************@uni-berlin.de...
Pugi! wrote:
On a freshly installed Fedora C3 (incl. webserver apache php mysql) i get
the following problem when connecting to mysql through a browser
(phpMyAdmin):
:
#2002 Can't connect to local MySQL server through socket
/var/lib/mysql/mysql.sock


This kind of messages are common when people haven't started the mysql
server.

chkconfig --level 35 mysqld on
/etc/init.d/mysqld start
//Aho

Jul 20 '05 #3

P: n/a
Pugi! wrote:
The correct answer was : adjust settings SELinux for httpd/apache.


How would that editing be done? I'm getting similar errors:

rich@linux:~> mysql -u root --host=localhost;
ERROR 2002: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)
rich@linux:~> mysql -u root --host=localhost
ERROR 2002: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)
rich@linux:~> mysql -u root -h localhost;
ERROR 2002: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)
rich@linux:~> mysql -uroot -hlocalhost;
ERROR 2002: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)
rich@linux:~> mysql -uroot --host="localhost"
ERROR 2002: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)
rich@linux:~>

I should have no password yet since this is a brand new installation of
Linux with Apache, MySQL, and PHP. The '/var/lib/mysql/' directory is
empty. But if I put -p password I get prompted for a password, which is
always wrong and sends me back to the command line.
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.