問(wèn)題描述
我有一個(gè) Ubuntu 14.04.在運(yùn)行 Owncloud 的地方安裝了 LAMP 的服務(wù)器.我嘗試安裝 paperwork 但沒(méi)有成功但這不是問(wèn)題.
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.
重新啟動(dòng)服務(wù)器后,我嘗試再次訪(fǎng)問(wèn)自己的云,但遇到內(nèi)部服務(wù)器錯(cuò)誤.見(jiàn)下圖.自己的云錯(cuò)誤
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 并且有以下短語(yǔ):
I looked in the log /var/log/apache2/error.log and theres following phrase:
Lost connection to MySQL server during query' in ...
我嘗試重啟mysql服務(wù)但是出現(xiàn)這個(gè)錯(cuò)誤:
I tried to restart the mysql service but this error appears:
stop: Unknown instance:
start: Job failed to start
然后我嘗試使用 mysql -u root -p
登錄到 mysql 并且出現(xiàn)以下錯(cuò)誤:
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
在機(jī)器上尋找套接字,套接字在那里: /run/mysqld/
.我創(chuàng)建了一個(gè)符號(hào)鏈接并將其粘貼到 /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
不幸的是沒(méi)有任何效果.再次重新啟動(dòng)后,我再也找不到套接字 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
更新
我已經(jīng)重新安裝了服務(wù)器,所以問(wèn)題解決了 :D
I've reinstalled the server so problem is over :D
推薦答案
如果你安裝了lampp服務(wù)器,先運(yùn)行mysql
If you install lampp server, run mysql first
sudo /opt/lampp/lampp startmysql
然后在/var/run 中創(chuàng)建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
運(yùn)行 mysql -u root -p
.希望能幫到你
run mysql -u root -p
. hope may help you
這篇關(guān)于Ubuntu:無(wú)法通過(guò)套接字'/var/run/mysqld/mysqld.sock'連接到本地MySQL服務(wù)器(2)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!