mysqldump: Got error: 2002: Can't connect to local MySQL server through socket ''

gvh

Verified User
Joined
May 14, 2010
Messages
37
Code:
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '' (111) when trying to connect
       Dumping database zdak_motali
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '' (111) when trying to connect
Found /usr/local/directadmin/custombuild/mysql/MySQL-client-5.1.62-1.glibc23.x86_64.rpm
Found /usr/local/directadmin/custombuild/mysql/MySQL-devel-5.1.62-1.glibc23.x86_64.rpm
Found /usr/local/directadmin/custombuild/mysql/MySQL-server-5.1.62-1.glibc23.x86_64.rpm
Found /usr/local/directadmin/custombuild/mysql/MySQL-shared-5.1.62-1.glibc23.x86_64.rpm
Stopping mysqld ...
Shutting down MySQL.....                                   [  OK  ]
Updating MySQL 5.1.62 to 5.1.62
Preparing...                ########################################### [100%]
        package MySQL-shared-5.1.62-1.glibc23.x86_64 is already installed
        package MySQL-client-5.1.62-1.glibc23.x86_64 is already installed
        package MySQL-server-5.1.62-1.glibc23.x86_64 is already installed
Starting MySQL.                                            [  OK  ]
Giving mysqld a few seconds to start up...
Looking for 'mysql' as: /usr/bin/mysql
Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Running 'mysqlcheck' with connection arguments: '--socket=/var/lib/mysql/mysql.sock' '--socket='
/usr/bin/mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '' (111) when trying to connect
FATAL ERROR: Upgrade failed
/usr/bin/mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '' (111) when trying to connect
cp: `/usr/lib/libmysqlclient.so' and `/usr/lib/mysql/libmysqlclient.so' are the same file
Restarting MySQL.
Shutting down MySQL.....                                   [  OK  ]
Starting MySQL.                                            [  OK  ]
It is recommended to do "./build php n" after MySQL update.

http://www.directadmin.com/forum/showthread.php?t=12324&page=1
http://www.directadmin.com/forum/showthread.php?t=31795&page=1

ım used this command
Code:
./build php n

after used this command

Code:
./build mysql

ı removed /etc/my.cnf and restarted server
after ./build mysql

not fixied not working . . . I tried all methods but not fixed..

can you help me . . .

centos 5.8 8 ram amd x6 T1075 server
 
Hello,

Post here results for

Code:
 tail -n 50 /var/lib/mysql/`hostname`.err

so we could see what is wrong there.
 
Code:
20418 14:52:13 [Note] /usr/sbin/mysqld: Normal shutdown

120418 14:52:13 [Note] Event Scheduler: Purging the queue. 0 events
120418 14:52:13  InnoDB: Starting shutdown...
120418 14:52:18  InnoDB: Shutdown completed; log sequence number 0 1566627632
120418 14:52:18 [Note] /usr/sbin/mysqld: Shutdown complete

120418 14:52:18 mysqld_safe mysqld from pid file /var/lib/mysql/sn1.domainyonlendir.net.pid ended
120418 14:52:19 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120418 14:52:19 [Note] Plugin 'FEDERATED' is disabled.
120418 14:52:19  InnoDB: Initializing buffer pool, size = 8.0M
120418 14:52:19  InnoDB: Completed initialization of buffer pool
120418 14:52:19  InnoDB: Started; log sequence number 0 1566627632
120418 14:52:19 [Note] Event Scheduler: Loaded 0 events
120418 14:52:19 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.62'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
120418 14:52:25 [Note] /usr/sbin/mysqld: Normal shutdown

120418 14:52:25 [Note] Event Scheduler: Purging the queue. 0 events
120418 14:52:27  InnoDB: Starting shutdown...
120418 14:52:29  InnoDB: Shutdown completed; log sequence number 0 1566627642
120418 14:52:29 [Note] /usr/sbin/mysqld: Shutdown complete

120418 14:52:29 mysqld_safe mysqld from pid file /var/lib/mysql/sn1.domainyonlendir.net.pid ended
120418 14:52:30 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120418 14:52:30 [Note] Plugin 'FEDERATED' is disabled.
120418 14:52:30  InnoDB: Initializing buffer pool, size = 8.0M
120418 14:52:30  InnoDB: Completed initialization of buffer pool
120418 14:52:30  InnoDB: Started; log sequence number 0 1566627642
120418 14:52:30 [Note] Event Scheduler: Loaded 0 events
120418 14:52:30 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.62'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
120418 14:52:49 [Note] /usr/sbin/mysqld: Normal shutdown

120418 14:52:49 [Note] Event Scheduler: Purging the queue. 0 events
120418 14:52:51  InnoDB: Starting shutdown...
120418 14:52:55  InnoDB: Shutdown completed; log sequence number 0 1566627868
120418 14:52:55 [Note] /usr/sbin/mysqld: Shutdown complete

120418 14:52:55 mysqld_safe mysqld from pid file /var/lib/mysql/sn1.domainyonlendir.net.pid ended
120418 14:52:56 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120418 14:52:56 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
120418 14:52:56 [Warning] 'record_buffer' is deprecated and will be removed in a future release. Please use 'read_buffer_size' instead.
120418 14:52:56 [Note] Plugin 'FEDERATED' is disabled.
120418 14:52:56  InnoDB: Initializing buffer pool, size = 8.0M
120418 14:52:56  InnoDB: Completed initialization of buffer pool
120418 14:52:56  InnoDB: Started; log sequence number 0 1566627868
120418 14:52:56 [Note] Event Scheduler: Loaded 0 events
120418 14:52:56 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.62'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)




so what can I do
 
You need to update your /etc/my.cnf

120418 14:52:56 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
120418 14:52:56 [Warning] 'record_buffer' is deprecated and will be removed in a future release. Please use 'read_buffer_size' instead.
 
Note, it seems that MySQL started OK:

120418 14:52:56 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.62' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
 
this is my my.cnf

Code:
[mysqld]
local-infile=0
skip-external-locking
query_cache_limit=1M
query_cache_size=32M
query_cache_type=1
max_connections=500
interactive_timeout=100
wait_timeout=100
connect_timeout=10
thread_cache_size=128
key_buffer=16M
join_buffer=1M
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=2M
read_buffer_size=2M
max_connect_errors=10
# Try number of CPU's*2 for thread_concurrency
thread_concurrency=2
myisam_sort_buffer_size=64M
server-id=1

[client]
socket=/var/lib/mysql/mysql.sock

[safe_mysqld]
err-log=/var/log/mysqld.log
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer_size=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer_size=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout




ı edited but error countinu .. ...

mysqldump error output: mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '' (111) when trying to connec


can you edit this my.cnf ?
 
tail record

Version: '5.1.62' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
120418 14:52:49 [Note] /usr/sbin/mysqld: Normal shutdown

120418 14:52:49 [Note] Event Scheduler: Purging the queue. 0 events
120418 14:52:51 InnoDB: Starting shutdown...
120418 14:52:55 InnoDB: Shutdown completed; log sequence number 0 1566627868
120418 14:52:55 [Note] /usr/sbin/mysqld: Shutdown complete

120418 14:52:55 mysqld_safe mysqld from pid file /var/lib/mysql/sn1.domainyonlendir.net.pid ended
120418 14:52:56 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120418 14:52:56 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Pleas e use '--skip-external-locking' instead.
120418 14:52:56 [Warning] 'record_buffer' is deprecated and will be removed in a future release. Please use 'read_buffer_size' instead.
120418 14:52:56 [Note] Plugin 'FEDERATED' is disabled.
120418 14:52:56 InnoDB: Initializing buffer pool, size = 8.0M
120418 14:52:56 InnoDB: Completed initialization of buffer pool
120418 14:52:56 InnoDB: Started; log sequence number 0 1566627868
120418 14:52:56 [Note] Event Scheduler: Loaded 0 events
120418 14:52:56 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.62' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
120418 15:21:54 [Note] /usr/sbin/mysqld: Normal shutdown

120418 15:21:54 [Note] Event Scheduler: Purging the queue. 0 events
120418 15:21:56 InnoDB: Starting shutdown...
120418 15:21:58 InnoDB: Shutdown completed; log sequence number 0 1567110713
120418 15:21:58 [Note] /usr/sbin/mysqld: Shutdown complete

120418 15:21:58 mysqld_safe mysqld from pid file /var/lib/mysql/sn1.domainyonlendir.net.pid ended
120418 15:21:59 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120418 15:21:59 [Warning] 'record_buffer' is deprecated and will be removed in a future release. Please use 'read_buffer_size' instead.
120418 15:21:59 [Note] Plugin 'FEDERATED' is disabled.
120418 15:21:59 InnoDB: Initializing buffer pool, size = 8.0M
120418 15:21:59 InnoDB: Completed initialization of buffer pool
120418 15:21:59 InnoDB: Started; log sequence number 0 1567110713
120418 15:21:59 [ERROR] /usr/sbin/mysqld: unknown option '----skip-external-locking'
120418 15:21:59 [ERROR] Aborting

120418 15:21:59 InnoDB: Starting shutdown...
120418 15:22:04 InnoDB: Shutdown completed; log sequence number 0 1567110713
120418 15:22:04 [Note] /usr/sbin/mysqld: Shutdown complete

120418 15:22:04 mysqld_safe mysqld from pid file /var/lib/mysql/sn1.domainyonlendir.net.pid ended
120418 15:22:26 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120418 15:22:26 [Warning] 'record_buffer' is deprecated and will be removed in a future release. Please use 'read_buffer_size' instead.
120418 15:22:26 [Note] Plugin 'FEDERATED' is disabled.
120418 15:22:26 InnoDB: Initializing buffer pool, size = 8.0M
120418 15:22:26 InnoDB: Completed initialization of buffer pool
120418 15:22:26 InnoDB: Started; log sequence number 0 1567110713
120418 15:22:26 [Note] Event Scheduler: Loaded 0 events
120418 15:22:26 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.62' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
[root@sn1 custombuild]# tail -n 50 /var/lib/mysql/`hostname`.err
Version: '5.1.62' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
120418 14:52:49 [Note] /usr/sbin/mysqld: Normal shutdown

120418 14:52:49 [Note] Event Scheduler: Purging the queue. 0 events
120418 14:52:51 InnoDB: Starting shutdown...
120418 14:52:55 InnoDB: Shutdown completed; log sequence number 0 1566627868
120418 14:52:55 [Note] /usr/sbin/mysqld: Shutdown complete

120418 14:52:55 mysqld_safe mysqld from pid file /var/lib/mysql/sn1.domainyonlendir.net.pid ended
120418 14:52:56 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120418 14:52:56 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
120418 14:52:56 [Warning] 'record_buffer' is deprecated and will be removed in a future release. Please use 'read_buffer_size' instead.
120418 14:52:56 [Note] Plugin 'FEDERATED' is disabled.
120418 14:52:56 InnoDB: Initializing buffer pool, size = 8.0M
120418 14:52:56 InnoDB: Completed initialization of buffer pool
120418 14:52:56 InnoDB: Started; log sequence number 0 1566627868
120418 14:52:56 [Note] Event Scheduler: Loaded 0 events
120418 14:52:56 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.62' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
120418 15:21:54 [Note] /usr/sbin/mysqld: Normal shutdown

120418 15:21:54 [Note] Event Scheduler: Purging the queue. 0 events
120418 15:21:56 InnoDB: Starting shutdown...
120418 15:21:58 InnoDB: Shutdown completed; log sequence number 0 1567110713
120418 15:21:58 [Note] /usr/sbin/mysqld: Shutdown complete

120418 15:21:58 mysqld_safe mysqld from pid file /var/lib/mysql/sn1.domainyonlendir.net.pid ended
120418 15:21:59 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120418 15:21:59 [Warning] 'record_buffer' is deprecated and will be removed in a future release. Please use 'read_buffer_size' instead.
120418 15:21:59 [Note] Plugin 'FEDERATED' is disabled.
120418 15:21:59 InnoDB: Initializing buffer pool, size = 8.0M
120418 15:21:59 InnoDB: Completed initialization of buffer pool
120418 15:21:59 InnoDB: Started; log sequence number 0 1567110713
120418 15:21:59 [ERROR] /usr/sbin/mysqld: unknown option '----skip-external-locking'
120418 15:21:59 [ERROR] Aborting

120418 15:21:59 InnoDB: Starting shutdown...
120418 15:22:04 InnoDB: Shutdown completed; log sequence number 0 1567110713
120418 15:22:04 [Note] /usr/sbin/mysqld: Shutdown complete

120418 15:22:04 mysqld_safe mysqld from pid file /var/lib/mysql/sn1.domainyonlendir.net.pid ended
120418 15:22:26 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120418 15:22:26 [Warning] 'record_buffer' is deprecated and will be removed in a future release. Please use 'read_buffer_size' instead.
120418 15:22:26 [Note] Plugin 'FEDERATED' is disabled.
120418 15:22:26 InnoDB: Initializing buffer pool, size = 8.0M
120418 15:22:26 InnoDB: Completed initialization of buffer pool
120418 15:22:26 InnoDB: Started; log sequence number 0 1567110713
120418 15:22:26 [Note] Event Scheduler: Loaded 0 events
120418 15:22:26 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.62' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
 
mysql is working but I cannot update,backed up and import backup...
 
Code:
rpm -qa | grep -i ^mysql
?


Feel free to PM me for a quote, if you need my private help.
 
[root@sn1 custombuild]# rpm -qa | grep -i ^mysql
MySQL-devel-5.1.57-1.glibc23
MySQL-client-5.1.62-1.glibc23
MySQL-shared-5.1.62-1.glibc23
MySQL-server-5.1.62-1.glibc23
 
Not sure why it happens, I could suggest that you remove all MySQL-* rpms and install it again.

Note, I can not guarantee that you won't break anything when trying to do it. I can guarantee only my work done with my hands.
 
Hello,

If ever a custom my.cnf is involved, the first thing to try to remove the custom my.cnf, restart mysqld and see if that fixes it.
If it does, then it's something set the my.cnf. (or some my.cnf that mysqld has found.. could be /root/.my.cnf, for example)
Related: http://help.directadmin.com/item.php?id=329

So, try:
Code:
cd /etc
mv my.cnf my.cnf.custom
/etc/init.d/mysqld stop
#wait a few seconds
killall -9 mysqld mysqld_safe     #Just to make sure it's dead, in case the pid is out of sync
#wait a few seconds
/etc/init.d/mysqld start
The noteable error I'm seeing is:
Code:
through socket '' (111)
where the sockets 'value' is '' .. aka: blank. It's being overridden somewhere with an empty value.

2) Also make sure that /etc/initd.d/mysqld isn't anything but ours... maybe paste the output of:
Code:
ps ax | grep mysql

3) One it's all fixed, if you want a different my.cnf, we recommend using the my.cnf that comes with the packages.. ususally "my-huge.cnf" or "my-large.cnf" is sufficient to copy to /etc/my.cnf.
To find it, type "locate my-huge.cnf", and copy it to /etc/my.cnf and restart mysqld.

John
 
thanks for interest but error is countinu .. I used your command

Code:
[root@sn1 etc]# ps ax | grep mysql
28448 pts/0    S      0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/sn1.domainyonlendir.net.pid
28560 pts/0    Sl     0:01 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/sn1.domainyonlendir.net.err --pid-file=/var/lib/mysql/sn1.domainyonlendir.net.pid --socket=/var/lib/mysql/mysql.sock --port=3306
28602 pts/0    S+     0:00 grep mysql
 
Back
Top