MySQL重啟 Can’t connect to local MySQL server through socket

來源:互聯網
上載者:User
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' 就說說解決辦法吧:root@zby:~# /etc/init.d/mysql restart   是啟動不了了  網上說可能是/var/run/mysqld的許可權的問題,不過,我是通過apt-get install 安裝的,不會出現此問題root@zby:/var/run/mysqld# ll /var/run/mysqld/drwxr-xr-x 2 mysql root   80 2011-05-25 09:25 ./顯示屬主是mysql,沒有問題 此時可以通過下面方法解決:root@zby:/usr/bin# /usr/bin/mysql_install_db Installing MySQL system tables...OKFilling help tables...OK To start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your system                  …………root@zby:~#/etc/init.d/mysql start此時不出意外,/var/run/mysql/下就有mysqld.sock檔案了root@zby:~# ls /var/run/mysqld/mysqld.pid  mysqld.sockmysql_install_db 指令碼的目的是產生新的MySQL授權表。它不覆蓋已有的MySQL授權表,並且它不影響任何其它資料。如果你想要重新建立授權表,首先停止mysqld伺服器(如果它正運行) 

本文出自 “Stephen” 部落格,請務必保留此出處http://stephenzhao.blog.51cto.com/2515860/573267

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.