Debian This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-05-2006, 03:46 AM
|
#1
|
|
Member
Registered: Dec 2002
Location: us
Posts: 108
Rep:
|
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
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=321578
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
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 16M
|
I am really not sure this is related to mysql or bacula related error i am gussing problem could be mysql side.
One more thing also when i get this error message i can see mysql server is running and i can stop and start mysql server without any problem
I need expert advise here with mysql
Thanks for your help
|
|
|
|
05-05-2006, 05:47 AM
|
#2
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
One thing that can cause that problem is if you haven't started the mysqld service.
|
|
|
|
05-05-2006, 06:48 AM
|
#3
|
|
Member
Registered: Dec 2002
Location: us
Posts: 108
Original Poster
Rep:
|
thanks for your reply.I can confirm mysqld is running
ps -ef | grep mysqld
root 951 1 0 09:00 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe
root 987 951 0 09:00 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe
mysql 988 987 0 09:00 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
root 989 987 0 09:00 ? 00:00:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
mysql 990 988 0 09:00 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
mysql 991 990 0 09:00 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
mysql 992 990 0 09:00 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
mysql 993 990 0 09:00 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
mysql 994 990 0 09:00 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
mysql 995 990 0 09:00 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
mysql 996 990 0 09:00 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
mysql 997 990 0 09:00 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
mysql 998 990 0 09:00 ? 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
thanks
|
|
|
|
05-05-2006, 11:43 PM
|
#4
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
|
05-21-2008, 05:26 PM
|
#5
|
|
Member
Registered: May 2006
Posts: 39
Rep:
|
I'm also getting:
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?
|
|
|
|
05-21-2008, 08:17 PM
|
#6
|
|
Senior Member
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043
Rep:
|
Not sure if this is still an issue for you guys but I just installed mysql and found that my my.cnf file has the socket going to /var/run/mysqld
what do you get from the mysql shell when you type select version(); or from the linux shell mysql --version ?
|
|
|
|
05-22-2008, 08:20 AM
|
#7
|
|
Member
Registered: May 2006
Posts: 39
Rep:
|
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?
|
|
|
|
08-29-2010, 07:06 PM
|
#8
|
|
LQ Newbie
Registered: Aug 2010
Posts: 1
Rep:
|
MySQL connect ERROR
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)
|
|
|
|
08-29-2010, 09:32 PM
|
#9
|
|
Member
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724
Rep:
|
ps -ef | grep mysqld?
cat /path/to/my.cnf?
|
|
|
|
08-31-2010, 07:10 PM
|
#10
|
|
Senior Member
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,043
Rep:
|
@dused_finch
a few things come to mind. Normally this happens when you have don't have the mysql daemon started. most distros you can start it by typing in
Code:
/etc/init.d/mysqld start
and that should get you going. I think it can sometimes also be that after you did your install you will need to give root a password.
Code:
mysqladmin -u root password <enter password here>
You may want to check first that the dameon is atually running by doing a
Code:
ps -ef | grep mysql
|
|
|
|
07-26-2011, 12:55 PM
|
#11
|
|
LQ Newbie
Registered: Jul 2011
Posts: 1
Rep: 
|
mysqldump error
If mysqld is running and you still get this error, try finding what socket mysqld is runing on:
ps -aux | grep mysqld
Look for --socket=/path/to/mysql.sock
then use it as parameter on the mysqldump command:
mysqldump --socket=/path/to/mysql.sock -uXXXXX -pXXXXX database > database.sql
Hope this helps, regards.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 02:00 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|