国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看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>

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

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 国产精品网站在线看 | 亚洲欧洲精品成人久久奇米网 | 亚洲毛片在线观看 | 91在线看 | a级在线观看 | 欧美一区永久视频免费观看 | 亚洲欧美网站 | 国产98色在线 | 日韩 | 一区二区三区免费观看视频 | 一级免费毛片 | 无码日韩精品一区二区免费 | 日韩中文字幕av在线 | 免费一级在线 | 久久精品国产精品青草 | 久久久精品网站 | 亚洲精品乱码久久久久久按摩观 | 国产精品2 | 亚洲国产精品久久久久婷婷老年 | 国产高清精品一区二区三区 | 欧美成人精品一区二区男人看 | 久久夜夜| 欧美精品一区二区三区在线四季 | 国产尤物av | 欧美视频免费看 | 日韩福利 | 91精品一区二区三区久久久久久 | 欧美精品一区二 | 婷婷综合激情 | 亚洲精品一区二区三区在线 | 久久久久精 | 国产成人精品免费视频 | 国产九九九 | av网站推荐| 欧美天天| 青春草国产免费福利视频一区 | 中文字幕在线电影 | 情一色一乱一欲一区二区 | 国产高清精品一区 | 国产美女精品视频免费观看 | 日韩欧美在线一区二区 | 国产区在线观看 |