Mysql Server error Can't connect to local MySQL server through socket
DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Mysql Server error Can't connect to local MySQL server through socket
Hi Guys,
I am getting very starange error with Mysql and bacula backup
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
05-May 08:34 backup1-dir: *Console*.2006-05-05_08.29.18 Fatal error: sql_get.c:277 sql_get.c:277 query SELECT VolSessionId,VolSessionTime,PoolId,StartTime,EndTime,JobFiles,JobBytes,JobTDate,Job,JobStatus,Type,L evel,ClientId FROM Job WHERE JobId=237 failed:
I have checked the error message Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I am using Debisn sarge with mysql version 4.0.24 there seems to be bug reported for this
When i went in to the file /etc/mysql/my.cf i couldn't find the 'old_passwords = 1' what every one suggests.
My my.cf file as follows
Quote:
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 128K
#
# * Query Cache Configuration
#
query_cache_limit = 1048576
query_cache_size = 16777216
query_cache_type = 1
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
#log = /var/log/mysql.log
#log = /var/log/mysql/mysql.log
#
# Error logging goes to syslog. This is a Debian improvement
#
# Here you can see queries with especially long duration
#log-slow-queries = /var/log/mysql/mysql-slow.log
#
# The following can be used as easy to replay backup logs or for replication.
#server-id = 1
log-bin = /var/log/mysql/mysql-bin.log
# See /etc/mysql/debian-log-rotate.conf for the number of files kept.
max_binlog_size = 104857600
#binlog-do-db = include_database_name
#binlog-ignore-db = include_database_name
#
# * BerkeleyDB
#
# The use of BerkeleyDB is now discouraged and support for it will probably
# cease in the next versions.
skip-bdb
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Feature
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# If you want to enable SSL support (recommended) read the manual or my
# HOWTO in /usr/share/doc/mysql-server/SSL-MINI-HOWTO.txt.gz
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem
One difference I noticed is that your my.cnf file says "socket = /var/run/mysqld/mysqld.sock"
Mine says "socket = /var/lib/mysql/mysql.sock"
Check if the directory /var/lib/mysqld/ exists and not /var/lib/mysql/
Also, a twist on my original question. Maybe rather than the mysql server not running, you are trying to start a second server, and that socket is already being used. Do you know that the "(2)" at the end of the first line of the error message stands for?
Also, check the manual at "/usr/share/doc/packages/mysql/manual.pdf"
Perhaps there is something in there I didn't notice.
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
and even though I've gone through and installed 'mysql', I don't see file 'mysqld.sock' anywhere. Did I miss something, something that I didn't install yet? Any help would be great?
I have the directory /var/lib/mysql instead of /var/lib/mysqld as was mentioned in a previous post. I installed this a week ago on a different machine and it has the "mysqld" directory as it should and I can't think what I missed this time. Are the mysqld.* files created during the "apt-get install snort-mysql" process?
having problems with this one lately..
what should be done in order to fix this..need help...
we are currently using vicidial VERSION: 2.0.5-173
BUILD: 90320-0424
MySQL connect ERROR: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (11)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.