激情久久久_欧美视频区_成人av免费_不卡视频一二三区_欧美精品在欧美一区二区少妇_欧美一区二区三区的

服務器之家:專注于服務器技術及軟件下載分享
分類導航

Mysql|Sql Server|Oracle|Redis|MongoDB|PostgreSQL|Sqlite|DB2|mariadb|Access|數據庫技術|

服務器之家 - 數據庫 - Mysql - mysql服務啟動卻連接不上的解決方法

mysql服務啟動卻連接不上的解決方法

2020-07-23 14:05CyanSkye Mysql

這篇文章主要為大家詳細介紹了mysql服務啟動卻連接不上的解決方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下

mysql服務啟動,但是連接不上,如何解決?

登陸報錯:

?
1
2
3
4
5
6
7
8
9
root@localhost:~# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
root@localhost:~# service mysqld restart
Shutting down MySQL..                   [ OK ]
Starting MySQL.                      [ OK ]
root@localhost:~# mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

分析原因:

原因不詳,知道了補上

解決方案一:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
root@localhost:~# find / -name mysql.sock
/tmp/mysql.sock
root@localhost:~# mysql -u root -p -S /tmp/mysql.sock
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.15-log Source distribution
 
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
mysql>

解決方案二:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
root@localhost:~# find / -name mysql.sock
 /tmp/mysql.sock
 root@localhost:~# vi /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
 
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0
 
# 加上下面的這段代碼即可
[mysql]
socket=/tmp/mysql.sock
 
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
 
root@localhost:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.15-log Source distribution
 
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
mysql>

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持服務器之家。

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 9999在线视频 | 艹男人的日日夜夜 | 婷婷中文字幕一区二区三区 | a一级黄色毛片 | 国产精品久久久久国产精品三级 | 韩日黄色片| 精品亚洲在线 | 黄网站进入 | 日韩欧美电影在线观看 | 国内精品伊人久久久久网站 | 欧美激情精品久久久久久久久久 | 日本一级黄色毛片 | 久久精品视频免费观看 | 未成年人在线观看 | 日韩视频一二三 | 毛片在线看免费 | 久久久久久久高清 | 国产69精品久久久久99尤 | 久国产精品视频 | 国产精品a一 | 欧美一级黄色片免费观看 | 久久久国产精品免费观看 | 久久国产精品二区 | 久久吊 | 精品在线观看一区二区三区 | 成人av一二三区 | 欧美性生交xxxxx免费观看 | 欧美日韩在线视频一区 | 午夜视频你懂的 | 黄色片在线观看网站 | 国产精品1区2区在线观看 | 香蕉久久久 | 欧美18一12sex性处hd | 九一国产精品 | 久久久久久久亚洲精品 | 中国毛片在线观看 | 久久久久久免费 | 国产成人强伦免费视频网站 | www.99av| 久久久久久久久久久高潮一区二区 | 亚洲第一男人天堂 |