Exception info: Can´t connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

85 views
Skip to first unread message

sstg...@web.de

unread,
Sep 27, 2017, 4:51:41 AM9/27/17
to SoPHIE Community
Dear Sophie users,
I received an error message (see attachment) from the SoPHIE database.
Since then I can not log on to the SoPHIE Portal.
Can someone help me fix the error?

My SoPHIE 3.0.3 works with the LINUX operating system.

Many thanks for your help.
Stephan
Fehlermeldung.png

A. Hendriks

unread,
Oct 26, 2017, 10:39:33 AM10/26/17
to SoPHIE Community
Hi Stephan,

SoPHIE relies on the MySQL Server to run. The user credentials as well as the session data is stored in the database.

Thus this is not really a SoPHIE specific problem but of course related as MySQL is a critical component. As discussed we would be happy to analyse the source of the error with you.

For everyone who might face problems with MySQL like this there are a few things you can do to pin down the source of the problem:

1. Check if the mysql is running

On the command line use the following command to see a filtered list of processes on the computer.

> ps aux | grep mysqld

This should show lines similar to this for Debian and similar Linux systems:

root     17809  0.0  0.0   4188   576 ?        S    Jun08   0:00 /bin/sh /usr/bin/mysqld_safe
mysql    18282  2.3 11.2 2520692 1816212 ?     Sl   Jun08 4674:40 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/run/mysqld/mysqld.sock --port=3306
root     18283  0.0  0.0   7712   652 ?        S    Jun08   0:00 logger -t mysqld -p daemon.error

If there is none of these lines the mysql process is not started.

2. Try to start the mysql service if not running

MySQL is mostly configured to automatically start when the Operation System starts. The default way to start, restart and stop services again depends on the Operation System and also the version of the Operation System you use. The following command should work for most Debian installations.

> service mysql start

3. Try to the MySQL CLI Client

On the command line use the CLI client to connect to mysql to make sure you use the correct credentials. The user is passed as a parameter. It will ask you for the password afterward, so the -p without the password is correct.

> mysql -u YOURMYSQLUSER -p YOURDATABASENAME

4. Check the Log-Files

Check the MySQL Log-Files for errors preventing it from starting or preventing it from being connected to:

/var/log/mysql.err
/var/log/mysql.log

5. Check the Harddrive Space and Memory

A full harddrive and full memory can lead to situations that are hard to analyse because logs are not written anymore.

Look at the usage of your harddrive partitions
> df -h 

Look at the available memory
> free -h

Hope these comments are helpful and please feel free to add comments to this or ask questions.

Best
 Achim

sstg...@web.de

unread,
Oct 28, 2017, 11:22:49 AM10/28/17
to SoPHIE Community
Hi Achim,
thanks for your help. I have try your recommendations. The problem is that I can´t start my mysql.
The error note is:

[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: Fehler beim Bearbeiten von mysql-server-5.5 (--configure):
 Unterprozess installiertes post-installation-Skript gab den Fehlerwert 1 zurück
Fehler traten auf beim Bearbeiten von:
 mysql-server-5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)

Best regards
Stephan

sstg...@web.de

unread,
Oct 29, 2017, 5:43:15 AM10/29/17
to SoPHIE Community
Hi Achim, here additional informations to available memory

df -h
Dateisystem    Größe Benutzt Verf. Verw% Eingehängt auf
/dev/root         15G      3,1G     11G   22% /
devtmpfs         459M       0      459M    0% /dev
tmpfs               93M    264K      93M    1% /run
tmpfs               5,0M       0        5,0M    0% /run/lock
tmpfs              186M       0       186M    0% /run/shm
/dev/mmcblk0p1   56M     20M   36M   36% /boot

free -h
                   total         used        free     shared    buffers     cached
Mem:          925M       471M       454M         0B        85M       233M
-/+ buffers/cache:       152M       773M
Swap:          99M         0B        99M

Best regards
Stephan

A. Hendriks

unread,
Oct 30, 2017, 5:51:10 AM10/30/17
to SoPHIE Community
Hi Stephan,

the memory checks for hdd and ram look good but it seems that the mysql received an update that did not go through well.

You can check the log files a little more or try to rerun the package managers configuration using the command dpkg-reconfigure. But I think this is outside of the scope of this list as it seems to be a specific mysql problem. Please also be aware that some of the logs might contain private information that you dont want to post here even though it might help.

Most important please make a backup of the /va/lib/mysql director before trying any of this though to make sure you dont lose your data if it fails.

We can offer to look into it using remote access tools. Please contact us under sup...@sophielabs.com if you would like to do so.

Best
 Achim
Reply all
Reply to author
Forward
0 new messages