Mysql down after restart container community

Questions/problems on Docker
Post Reply
thib
Posts: 9
Joined: Thu Jul 09, 2015 9:31 pm

Mysql down after restart container community

Post by thib » Mon Nov 16, 2015 12:58 am

hi,

Mysql was down after restart container servercommunity.

Code: Select all

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Reboot mysql failed

Dean
Posts: 700
Joined: Tue Sep 30, 2014 11:04 am

Re: Mysql down after restart container community

Post by Dean » Mon Nov 16, 2015 7:45 am

First, I would advise you to check the port 3306 to be free.

As far as the mysql.server is not started, I would also advise to try this:

Code: Select all

/etc/init.d/mysqld start

thib
Posts: 9
Joined: Thu Jul 09, 2015 9:31 pm

Re: Mysql down after restart container community

Post by thib » Mon Nov 16, 2015 8:53 am

my.cnf

Code: Select all

port            = 3306
socket          = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

[mysqld]
#
# * Basic Settings
#
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 127.0.0.1
and mysql restart reponse :

Code: Select all

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

thib
Posts: 9
Joined: Thu Jul 09, 2015 9:31 pm

Re: Mysql down after restart container community

Post by thib » Mon Nov 16, 2015 8:58 am

my sql log :

Code: Select all

tail /var/log/mysql/error.log

InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
151116  8:55:58  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: Error: could not open single-table tablespace file
InnoDB: ./onlyoffice/projects_milestones.ibd!
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
151116 08:55:58 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

Dean
Posts: 700
Joined: Tue Sep 30, 2014 11:04 am

Re: Mysql down after restart container community

Post by Dean » Mon Nov 16, 2015 12:50 pm

Try to check access rights. According to the logfiles, that could be the issue.

Code: Select all

ls -als /var
ls -als /var/run
ls -als /var/run/mysqld
ls -als /var/run/mysqld/mysqld.sock

thib
Posts: 9
Joined: Thu Jul 09, 2015 9:31 pm

Re: Mysql down after restart container community

Post by thib » Mon Nov 16, 2015 2:26 pm

Code: Select all

root@eba711817caa:/# ls -als /var
total 48
4 drwxr-xr-x 19 root root   4096 Nov 16 08:38 .
4 drwxr-xr-x 49 root root   4096 Nov 16 14:18 ..
4 drwxr-xr-x  2 root root   4096 Apr 10  2014 backups
4 drwxr-xr-x 11 root root   4096 Aug 21 09:18 cache
4 drwxr-xr-x 39 root root   4096 Nov 16 08:38 lib
4 drwxrwsr-x  2 root staff  4096 Apr 10  2014 local
0 lrwxrwxrwx  1 root root      9 Aug 14 08:32 lock -> /run/lock
4 drwxrwxr-x 13 root syslog 4096 Nov 16 08:38 log
4 drwxrwsr-x  2 root mail   4096 Aug 14 08:32 mail
4 drwxr-xr-x  2 root root   4096 Aug 14 08:32 opt
0 lrwxrwxrwx  1 root root      4 Aug 14 08:32 run -> /run
4 drwxr-xr-x  5 root root   4096 Aug 14 08:33 spool
4 drwxrwxrwt  2 root root   4096 Aug 14 08:34 tmp
4 drwxr-xr-x  4 root root   4096 Nov 16 08:38 www

Code: Select all

root@eba711817caa:/# ls -als /var/run
0 lrwxrwxrwx 1 root root 4 Aug 14 08:32 /var/run -> /run

Code: Select all

root@eba711817caa:/# ls -als /var/run/mysqld
total 8
4 drwxr-xr-x  2 mysql root 4096 Nov 16 08:37 .
4 drwxr-xr-x 12 root  root 4096 Nov 16 08:38 ..

Code: Select all

root@eba711817caa:/# ls -als /var/run/mysqld/mysqld.sock
ls: cannot access /var/run/mysqld/mysqld.sock: No such file or directory

Code: Select all

root@eba711817caa:/# tail /var/log/mysql/error.log 
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
151116 14:20:16 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ende
( information : this bug was in fresh install with onclikinstall on ubuntu 15.04 )

Dean
Posts: 700
Joined: Tue Sep 30, 2014 11:04 am

Re: Mysql down after restart container community

Post by Dean » Tue Nov 17, 2015 7:19 am

OK, we've checked it out.

The easiest way to fix this one is to reinstall one-click, as far all the data are mapped to host.

Another way is to create mysqld.sock by 'touch'

thib
Posts: 9
Joined: Thu Jul 09, 2015 9:31 pm

Re: Mysql down after restart container community

Post by thib » Thu Nov 19, 2015 6:23 pm

tks,

but after a second install, I have same error.

If I do a manual installation, I have the same error. :(

Dean
Posts: 700
Joined: Tue Sep 30, 2014 11:04 am

Re: Mysql down after restart container community

Post by Dean » Thu Nov 26, 2015 12:56 pm

Please try to 'touch' mysqld.sock. If it doesn't help, please, contact us again.

Post Reply