반응형
오류 2002(HY000):소켓 '/var/lib/mysql/mysql'을(를) 통해 로컬 MySQL 서버에 연결할 수 없습니다.sock' (111 "연결 거부") centos 6
Centos 6, 개방형 속도 설치, 마리아 사용DB
MySQL은 갑자기 중지되어 시작할 수 없을 때까지 정상적으로 작동합니다.
[root@backup ~]# service mysql start
Starting MySQL.170815 09:56:24 mysqld_safe Logging to '/var/lib/mysql/backup.err'.
170815 09:56:24 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
..... ERROR!
/var/lib/backup.err:
170814 06:44:02 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2017-08-14 6:44:02 3069880736 [Note] /usr/sbin/mysqld (mysqld 10.1.25-MariaDB) starting as process 3250 ...
2017-08-14 6:44:02 3069880736 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.
2017-08-14 6:44:02 3069880736 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2017-08-14 6:44:02 3069880736 [Note] InnoDB: The InnoDB memory heap is disabled
2017-08-14 6:44:02 3069880736 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-08-14 6:44:02 3069880736 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
2017-08-14 6:44:02 3069880736 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-08-14 6:44:02 3069880736 [Note] InnoDB: Using Linux native AIO
2017-08-14 6:44:02 3069880736 [Note] InnoDB: Using generic crc32 instructions
2017-08-14 6:44:02 3069880736 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-08-14 6:44:02 3069880736 [Note] InnoDB: Completed initialization of buffer pool
2017-08-14 6:44:02 3069880736 [Note] InnoDB: Highest supported file format is Barracuda.
2017-08-14 6:44:02 3069880736 [Note] InnoDB: Starting crash recovery from checkpoint LSN=2657313375
2017-08-14 6:44:02 3069880736 [Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
InnoDB: Set innodb_force_recovery to ignore this error.
2017-08-14 6:44:02 3069880736 [ERROR] Plugin 'InnoDB' init function returned error.
2017-08-14 6:44:02 3069880736 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-08-14 6:44:02 3069880736 [Note] Plugin 'FEEDBACK' is disabled.
2017-08-14 6:44:02 3069880736 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-08-14 6:44:02 3069880736 [ERROR] Aborting
Error in my_thread_global_end(): 1 threads didn't exit
170814 06:44:07 mysqld_safe mysqld from pid file /var/lib/mysql/backup.pid ended
MySQL 테스트:
[root@backup ~]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused")
/etc/my.cnf:
#
[client]
port = 3306
socket = /var/lib/mysql/mysql.sock
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
/etc/my.cnf.d/server.cnf:
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
# this is only for the mysqld standalone daemon
[mysqld]
#
# * Galera-related settings
#
[galera]
# Mandatory settings
#wsrep_on=ON
#wsrep_provider=
#wsrep_cluster_address=
#binlog_format=row
#default_storage_engine=InnoDB
#innodb_autoinc_lock_mode=2
#
# Allow server to accept connections on all interfaces.
#
#bind-address=0.0.0.0
#
# Optional setting
#wsrep_slave_threads=1
#innodb_flush_log_at_trx_commit=0
# this is only for embedded server
[embedded]
# This group is only read by MariaDB servers, not by MySQL.
# If you use the same .cnf file for MySQL and MariaDB,
# you can put MariaDB-only options here
[mariadb]
# This group is only read by MariaDB-10.1 servers.
# If you use the same .cnf file for MariaDB of different versions,
# use this group for options that older servers don't understand
[mariadb-10.1]
이미 MariaDB 서버와 클라이언트를 제거하고 다시 설치했지만 여전히 작동하지 않습니다.
[root@backup ~]# service mysql restart
ERROR! MySQL server PID file could not be found!
Starting MySQL.170815 11:33:12 mysqld_safe Logging to '/var/lib/mysql/backup.err'.
170815 11:33:12 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
..... ERROR!
ERROR! Failed to restart server.
[root@backup ~]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111 "Connection refused")
grep "grep"
[root@backup ~]# mysqld --verbose --help | grep "socket"
2017-08-15 18:05:44 3070110112 [Note] Plugin 'FEEDBACK' is disabled.
Buffer length for TCP/IP and socket communication
--performance-schema-max-socket-classes=#
Maximum number of socket instruments.
--performance-schema-max-socket-instances=#
Maximum number of opened instrumented sockets. Use 0 to
the slave off the socket once the slave connects. Due to
--socket=name Socket file to use for connection
performance-schema-max-socket-classes 10
performance-schema-max-socket-instances -1
socket /var/lib/mysql/mysql.sock
무엇이 잘못되고 있는 것일까요?
언급URL : https://stackoverflow.com/questions/45695228/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-var-lib
반응형
'sourcecode' 카테고리의 다른 글
구문 분석에서 jQuery AJAX 요청에서 HTML을 반환했습니다. (0) | 2023.09.10 |
---|---|
XML, HTML 및 XHTML 문서에 유효한 내용 유형 (0) | 2023.09.10 |
문서를 사용하는 HTML에 javascript를 동적으로 삽입합니다.글을 쓰다 (0) | 2023.09.10 |
Java용 LINQ 도구 (0) | 2023.09.10 |
공백까지 데이터를 선택하시겠습니까? (0) | 2023.09.10 |