3

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

I looked in the log /var/log/apache2/error.log and theres following phrase:

Lost connection to MySQL server during query' in ...

I tried to restart the mysql service but this error appears:

stop: Unknown instance:
start: Job failed to start

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)

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

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

Update

I've reinstalled the server so problem is over :D

Sandro_V
  • 477
  • 1
  • 7
  • 21

3 Answers3

4

If you install lampp server, run mysql first

sudo /opt/lampp/lampp startmysql

Then make "mysqld" directory in /var/run

cd /var/run
sudo mkdir mysqld

Link your mysql from lampp to /var/run/mysqld

sudo ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock

run mysql -u root -p . hope may help you

akhisyabab
  • 179
  • 2
  • 7
0
  1. If you install LAMPP server, run MySQL first
sudo /opt/lampp/lampp startmysql
  1. Then make "mysqld" directory in /var/run
cd /var/run
sudo mkdir mysqld
  1. Link your mysql from lampp to /var/run/mysqld
sudo ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock
  1. run MySQL
mysql -u root -p . 
  1. If MySQL fails with «mysql» not found, install:
sudo apt install mysql-client-core-5.7   
sudo apt install mariadb-client-core-10.1
Evgeny Minkevich
  • 2,319
  • 3
  • 28
  • 42
-1

There is any issues with the mysql services. Please try to restart mysql services and check the mysql error logs for more information

24x7servermanagement
  • 2,520
  • 1
  • 13
  • 11