問題描述
我有一個 Ubuntu 14.04.在運行 Owncloud 的地方安裝了 LAMP 的服務器.我嘗試安裝 paperwork 但沒有成功但這不是問題.
I have a Ubuntu 14.04. server with LAMP installed where an Owncloud is running. I tried to install paperwork which didn't work out but thats not the problem.
重新啟動服務器后,我嘗試再次訪問自己的云,但遇到內部服務器錯誤.見下圖.自己的云錯誤
After restarting my server I tried to access my owncloud again but I am facing an internal server error. See following picture. Owncloud error
我查看了日志/var/log/apache2/error.log 并且有以下短語:
I looked in the log /var/log/apache2/error.log and theres following phrase:
Lost connection to MySQL server during query' in ...
我嘗試重啟mysql服務但是出現這個錯誤:
I tried to restart the mysql service but this error appears:
stop: Unknown instance:
start: Job failed to start
然后我嘗試使用 mysql -u root -p
登錄到 mysql 并且出現以下錯誤:
Then I tried to login to mysql with mysql -u root -p
and follorwing error appears:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
我用 find/-type s
在機器上尋找套接字,套接字在那里: /run/mysqld/
.我創建了一個符號鏈接并將其粘貼到 /var/run/mysqld/mysqld.sock
I've looked for the sockets on the machine with find / -type s
and the socket was there: /run/mysqld/
.
I created a symbolic link and pasted it to /var/run/mysqld/mysqld.sock
不幸的是沒有任何效果.再次重新啟動后,我再也找不到套接字 find/-type s
的輸出是:
Unfortnutely nothing worked. After restarting again I can't find the socket anymore the output of find / -type s
is:
/dev/log
/run/php5-fpm.sock
/run/udev/control
find: `/proc/977/task/977/fd/5': No such file or directory
find: `/proc/977/task/977/fdinfo/5': No such file or directory
find: `/proc/977/fd/5': No such file or directory
find: `/proc/977/fdinfo/5': No such file or directory
更新
我已經重新安裝了服務器,所以問題解決了 :D
I've reinstalled the server so problem is over :D
推薦答案
如果你安裝了lampp服務器,先運行mysql
If you install lampp server, run mysql first
sudo /opt/lampp/lampp startmysql
然后在/var/run 中創建mysqld"目錄
Then make "mysqld" directory in /var/run
cd /var/run
sudo mkdir mysqld
將你的mysql從lampp鏈接到/var/run/mysqld
Link your mysql from lampp to /var/run/mysqld
sudo ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock
運行 mysql -u root -p
.希望能幫到你
run mysql -u root -p
. hope may help you
這篇關于Ubuntu:無法通過套接字'/var/run/mysqld/mysqld.sock'連接到本地MySQL服務器(2)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!