473,242 Members | 1,800 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,242 software developers and data experts.

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

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
3 17758
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kesavan Athimoolam | last post by:
HI, Is there an equivalent in mysql for Transaction count variable of Sql server ? TIA, Kesavan
16
by: MLH | last post by:
Using MS Access, I have attached to MySQL servers in other states and other countries on the other side of my router. But when I use the MySQL ODBC driver 3.51 to connect to a MySQL server on my...
5
by: news.telia.net | last post by:
Hi! I have a question. I have installed php and mysql on an apache-server on windows and I can't connect to the server. I tried to create a database (since I am trying to learn howto). My...
0
by: madanis | last post by:
Hello Frnd, please help by telling how to connect with mysql database in vb.net what are thing to be require to connect if possible give me with code i means details abt connecting string of...
3
by: Vague | last post by:
Hello There, I've recently been working on a large project, very database driven, in C# on windows systems, calling a MySQL database on a linux box. The project is going very well. Except that...
5
by: maverickx | last post by:
Hi everyone, i am a totally rookie in perl. I have a project which needs to use perl to connect to mysql database. I already installed the perl mysql driver, MySQL, and use perl code which i found...
5
by: mtuller | last post by:
I would like to encrypt data passed between my web server and the database server. I have looked all over, but don't see any information on how to connect to mysql via ssh with php. Is it possible?
5
by: Evan Jou | last post by:
Hi there, I have a simple question for you experts here that I've installed Apache, PHP and MySQL on my Windows machine and set up a test script(test.php) like what is listed in a book. It's...
1
by: mahesan | last post by:
How you connect to mySQL Server using PHP: we have a mySQL server in one host,say, 192.168.1.100 I am trying a program from 192.168.1.200, How do I make use of the databases in the mySQL...
1
by: andi christiano | last post by:
how configure connection database using mysql in xampp for windows use Mysql; use HTTP::Request::Common qw(POST); use LWP::UserAgent; use MIME::Base64; why cann't start / running
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.