473,703 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 17805
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.n et> 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
1576
by: Kesavan Athimoolam | last post by:
HI, Is there an equivalent in mysql for Transaction count variable of Sql server ? TIA, Kesavan
16
27918
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 own LAN, the driver tells me it cannot make the connection. Here are the ODBC driver connection parms: Data Source Name: (free field - name my "my linux box" will do nicely) Host/Server Name (or IP) - something like MSQLUserName@ServerName.net...
5
4568
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 manual said I should write this at the shell: c:\mysql\bin>mysqladmin -u root creare mindb I did this and got this error:
0
2078
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 mysql with vb.net code thanks in advance
3
3956
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 simple calls that are sometimes instant, will also sometimes take 10 - 20 seconds. If I were to click a button that refreshes a table, 7 times out of 10 it will be instant, the other 3 times it will lag. Some details... All computers that are running...
5
1846
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 on the internet to connect to the mysql database. However, it says the connection was denied. I didnt set username and password for the database. So which problems might result in this situation, need help please
5
4587
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
1971
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 like <?php @mysql_connect("localhost","root","password") or die("Could not connect to MySQL server!); @mysql_select_db("mysql")
1
1687
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 Server? thanks Ma
1
1447
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
8760
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8670
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9254
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5923
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4433
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2458
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2070
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.