将设为首页浏览此站
开启辅助访问 天气与日历 收藏本站联系我们切换到窄版

易陆发现论坛

 找回密码
 开始注册
查看: 175|回复: 0
收起左侧

ERROR 2002 (HY000): Can't connect to local MySQL server through socket mysql报错解

[复制链接]
发表于 2022-9-22 11:55:32 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?开始注册

x
[root@ceph1 /]# mysql -uroot -p
- x, d/ x0 t& b0 f; VEnter password:
* q4 T. Q  [' CERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)2 X: V$ B7 I# o8 g( u; t
[root@ceph1 /]#
, `1 X7 G9 n+ E6 \[root@ceph1 /]#
2 V3 d: D! J' Q5 F3 b4 p[root@ceph1 /]#
4 i7 P2 t: u& b  C/ k6 @0 G- N9 k添加个client的配置# V# u9 Q. q' X6 q
[root@ceph1 /]# vim /etc/my.cnf
$ r' a' ~; o8 [" [0 k+ A) J
! p! [& g$ u# z! N- |, X7 K. {- {[client]" U4 T8 q4 I2 W# Z5 I/ l3 A
port=33062 ]9 ?3 f/ c/ q5 V/ x
socket=/var/lib/mysql/mysql.sock
4 j( x3 B& q/ [) K  J! _5 g
8 d! R0 g9 l4 Q6 ]) Y[root@ceph1 /]# service mysqld restart / L; @3 H& Q3 c, N' I8 d
Shutting down MySQL.. SUCCESS! $ ?, r8 Q' f8 w* x8 m( O( P" F
Starting MySQL.. SUCCESS!
4 T- }$ Q6 Y! c[root@ceph1 /]# mysql -uroot -p " W% r: z' x- j0 q, H
Enter password:
8 ]0 V. r8 S0 Z' O; M/ Q  mWelcome to the MySQL monitor.  Commands end with ; or \g.  [# s4 r. D' Z
Your MySQL connection id is 1
$ P; ?# Z1 c; L5 N# GServer version: 5.6.20 Source distribution# g3 d* t5 U8 F9 G- ^
* n; u' M6 Z' A$ }$ f9 j- g9 ?: h
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.7 k# X! w1 \$ L/ K
" |9 H! O$ b- i6 @
Oracle is a registered trademark of Oracle Corporation and/or its
7 O1 B2 O/ T$ t6 d. D* l4 Maffiliates. Other names may be trademarks of their respective: v5 k4 e: C, r9 I- H( D" l3 y
owners.
& k* o) d. I& J& w( S- v+ b
7 t; N' p# t1 b/ i0 vType 'help;' or '\h' for help. Type '\c' to clear the current input statement.6 e! ?% g) F# R7 {: ^% T

' y5 W! L& m& R/ u& [+ Tmysql>
! B- q3 |8 C4 T1 N9 Rmysql>
* {# I& z6 u+ x+ V! \0 O1 ?+ g) o% c5 w0 ]
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

如有购买积分卡请联系497906712

QQ|返回首页|Archiver|手机版|小黑屋|易陆发现 点击这里给我发消息

GMT+8, 2023-6-2 07:40 , Processed in 0.040976 second(s), 22 queries .

Powered by LR.LINUX.cloud bbs168x X3.2 Licensed

© 2012-2022 Comsenz Inc.

快速回复 返回顶部 返回列表