欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
mysql.sock的作用

標題:mysql.sock的作用

作者:lōττéry?版權所有[文章允許轉載,但必須以鏈接方式注明源地址,否則追究法律責任.]


注釋?zhuān)?/span>
  前段時(shí)間出現過(guò)一種情況,localhost本地登錄mysql數據庫提示不能連接mysql.sock,第三方工具sqlyog可以登錄,具體原因如下。

原創(chuàng )內容如下  mysql.sock的作用

mysql有兩種連接方式:
1、TCP/IP
2、socket
mysql.sock的作用是server和client在同一臺服務(wù)器,并且使用localhost進(jìn)行鏈接的時(shí)候,就會(huì )使用socket來(lái)進(jìn)行連接——僅此而已
也就是:為主機名為localhost建立的MySQL連接,該連接過(guò)程通過(guò)一個(gè)套接字文件mysql.socket實(shí)現的。所以該文件被刪后,用localhost用戶(hù)是連接不到MySQL服務(wù)器的。
必須建立一條tcp/ip連接,即使用127.0.0.1而不是localhost作為-h的參數去連接MySQL服務(wù)器,如:mysqladmin -h 127.0.0.1 -u root -p shutdown,強制地建立一條tcp/ip連接;
關(guān)閉MySQL服務(wù)器,再重新以localhost為主機名啟動(dòng)MySQL服務(wù)器,它就會(huì )重新創(chuàng )建一個(gè)套接字文件。


對上文加以測試深入了解;
查看mysql.sock具體路徑:
[root@Wonhigh-Test16 ~]# ps -ef | grep mysql.sock|grep -v "grep"
mysql    31108 30650  0 Sep10 ?        00:03:17 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/Wonhigh-Test16.err --pid-file=/var/lib/mysql/Wonhigh-Test16.pid --socket=/var/lib/mysql/mysql.sock --port=3306
[root@Wonhigh-Test16 ~]# 
轉移套接字文件 mysql.sock
[root@Wonhigh-Test16 ~]# mv /var/lib/mysql/mysql.sock /var/lib/mysql/mysql1.sock 
確認本地登錄情況
[root@Wonhigh-Test16 ~]# mysql -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@Wonhigh-Test16 ~]#
嘗試127.0.0.1 tcp/ip連接(第三方工具遠程連接都可以‘連接屬性會(huì )顯示為T(mén)CP/IP ’)
[root@Wonhigh-Test16 ~]# mysql -uroot -p123456 -h127.0.0.1
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 127
Server version: 5.6.19-log
Copyright (c) 2000, 2014, 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@Wonhigh-Test16 ~]# mv /var/lib/mysql/mysql1.sock /var/lib/mysql/mysql.sock
[root@Wonhigh-Test16 ~]# mysql -uroot -p123456
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 121
Server version: 5.6.19-log MySQL Community Server (GPL)
Copyright (c) 2000, 2014, 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> exit
Bye
[root@Wonhigh-Test16 ~]# 

  【源于本人筆記】 若有書(shū)寫(xiě)錯誤,表達錯誤,請指正... 
本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
解決Can't connect to local MySQL server through socket '/tmp/mysql.sock'錯誤
linux下同時(shí)運行多個(gè)mysql - 目標→Linux - 51CTO技術(shù)博客
Centos 更改MySQL5.7數據庫目錄位置
Mysql linux
MySQL數據庫root密碼忘記丟失重置方法
mysql安裝提示:invoke-rc.d: initscript mysql, action "start" failed
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久