麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 數(shù)據(jù)庫 > MySQL > 正文

mysql服務(wù)啟動(dòng)卻連接不上的解決方法

2024-07-24 13:12:52
字體:
供稿:網(wǎng)友

mysql服務(wù)啟動(dòng),但是連接不上,如何解決?

登陸報(bào)錯(cuò):

  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)

分析原因:

原因不詳,知道了補(bǔ)上

解決方案一:

 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>

解決方案二:

 root@localhost:~# find / -name mysql.sock /tmp/mysql.sock root@localhost:~# vi /etc/my.cnf[mysqld]datadir=/var/lib/mysqlsocket=/var/lib/mysql/mysql.sockuser=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.logpid-file=/var/run/mysqld/mysqld.pidroot@localhost:~# mysql -u root -pEnter password:Welcome to the MySQL monitor. Commands end with ; or /g.Your MySQL connection id is 3Server version: 5.6.15-log Source distributionCopyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.mysql>

以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持VeVb武林網(wǎng)。


注:相關(guān)教程知識(shí)閱讀請(qǐng)移步到MYSQL教程頻道。
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 少妇一级淫片免费看 | 日日艹夜夜艹 | 亚洲成人高清电影 | 成人区一区二区 | 久久精品欧美视频 | 涩涩操 | 天天草天天操 | 欧美一级免费视频 | 国产噜噜噜噜久久久久久久久 | 国产一级毛片高清 | 精品国产一区二区三 | 久久久久久久久成人 | 久久久久久久久亚洲精品 | 成年人黄色免费网站 | 日本羞羞的午夜电视剧 | 草草久久久 | 国产福利视频在线观看 | 精品久久久一 | 把娇妻调教成暴露狂 | 欧美一级性 | 男男啪羞羞视频网站 | 久久精品中文字幕一区二区 | 黄色免费不卡视频 | 久久久久九九九女人毛片 | 美女毛片在线观看 | 日本精品免费观看 | 精品国产一区二区三区在线观看 | 毛片免费在线 | 精品成人av一区二区在线播放 | 久久综合爱 | 久久久午夜电影 | 黄色大片网 | 久在线观看福利视频69 | 久久精品a一级国产免视看成人 | 国产亚洲精品久久久久久网站 | 国产精品美女久久久久久网站 | 亚洲国产精品99 | 国产亚洲精品久久久久久久 | 免费视频aaa | 欧美日本国产精品 | 在线成人免费av |