error: Can't connect to local MySQL server through socket
Hi all, if u please help me on this.
I get this error with mysql server: mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)' Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists! Well that file isn't there...dont' know why. I've installed mysql server within the istallation of red hat 9. And i've updated my distro but still get the same error. I need this service running to test my 'Koha' server. If u please help me... anything, I need to know how do I get this thing working. Also the service can start: # /etc/init.d/mysqld start Starting MySQL: [ OK ] but when trying to enter with mysqladmin -u <user> and all the rest, it fails with the error above. Please help... Thanks, Cheers. jose |
Hi J0sep,
Normally this socket is on "/var/lib/mysql/mysql.sock". You may have some configuration mismatch between the server and the admin. Until you discover the mismatch, you can link it by entering Code:
ln -s /var/lib/mysql/mysql.sock /tmp |
That actually solved a problem i've been having... could you possibly explain how i would go about finding this mismatch? I hate to leave it as a work around. I'd rather find the source of the problem.
Thanks, Chad Arimura |
Hi trippccn,
Look at the file "/etc/my.cnf". May be you could find a divergence in the position of this socket. Mine looks as Code:
mysql.server] |
Hi osvaldomarques,
My cnf is as follows. I wonder why the socket is set to /var/lib/mysql directory, but the php web application that was calling the db open function was looking for the /tmp/ sock. Could it be something I'm missing when I upgraded from 3.23 to 4.0.20? Code:
[mysqld] Chad |
I don't think so...
Historically all the sockets were open in /tmp, because they can be easily removed during boot up procedures. They don't need to exist when the server is not running. For a matter of security, nowadays, the things historically laid in /tmp are gaining another directories, because /tmp is accessible by all local users. The php server have a configuration, probably at "/etc/php4/apache/php.ini" where you can specify the location of the socket for php access. |
yum install mysql
hi i have installed mysql using command
yum install mysql My distro is Fedora 6 and it installed it succesfully but when i try service mysqld start it say unrecognized service. what will be the problem can any body address in this regards. |
Probably you installed only the client package. There is a package named "mysql-server" which contains the server. For more info about the available packages, use
Code:
yum list available|grep mysql |
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
hi i have installed mysql using command
yum install mysql My distro is Fedora 8 and it installed it succesfully but when i try service mysqld start it say Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) the Code of /etc/my.cnf is: [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid |
I am so happy!
I solve my error questions"Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'",because mysqld isn't run.We can find in "K menu-->setting-->service setting",if only you start mysqld ,you can input this "mysql -u root",then you can see this" mysql>". But I don't know yours' systems ,my system is fedora 8 and I use "yum install mysql"installing mysql. |
This best and quickest fix I've found for this
Just restart the mysql service
sudo /sbin/service mysqld restart that should refresh everything |
mysql on Mandriva 2008.1
Hello all. I am kinda frustrated as I am really looking to get a greeting card suite working. I am thinking that some sort of data base program is how proprietary greeting card programs actually work. That would be the rational behind sticking with this attempt. It does seem that all *nix tech stuff is the base for the more closed API flavors.
I have the some of the same issues discussed in this thread but still am not sure how to handle this. This thread is dated as well. Code: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) So could I use the advice posted in this thread for my issue. Sorry I am pretty lost as for what to do. |
httpd and mysqld difference
I got connection error to when tried to connect to mysql using mysql administrator also with 'mysql -u root'. I tried restarting httpd but cant fix it. Again I tried with 'service mysqld restart' and it worked.
Can anyone tell me whats the difference between httpd and mysqld. Thanks a lottt |
Quote:
And you might want to try Google if you need such basic knowledge.... |
Quote:
I came to this site as I am having a Linux software issue, but seeing this post has really put me off. This forum describes itself as "friendly" and it's tag-line is "where Linux users come for help". Really? someone asks a question and get's told he/she is being "rude" (as the question may have been asked in the 'wrong' place) and is advised to bugger off to google as the enquiry is deemed too "basic" to bother helping with? I think it's clear who is really being rude. It's quite disgraceful behaviour from someone posting on, supposedly, a help forum. |
All times are GMT -5. The time now is 06:13 PM. |