mysql stops suddenly without error

20 posts / 0 new
Last post
#1 Mon, 10/17/2011 - 06:21
neorf

mysql stops suddenly without error

I've found mysql stopped... but i don't know the cause... how can i check? Thanks

neorf

Mon, 10/17/2011 - 09:57
andreychek

Howdy,

Well, it may have crashed for some reason... has this happened more than once?

I'd begin by re-starting the MySQL server.

You may want to review your log files in /var/log for any signs as to what happened though.

Also, how much RAM is in your server? If you have too little RAM, it's possible that's related to why it crashed. You can determine that by running "free -m".

-Eric

Tue, 10/18/2011 - 06:00
neorf

i've not see any sign of error... but today strange it's that everyservice are running, webmin too... but i can't connect via :10000 port... as usual... just i get: page not found... Then my vps has 768Mb Ram what could be? Thanks

Tue, 10/18/2011 - 09:41
andreychek

You may want to try restarting Apache, and see if that helps.

What does this command output on your system:

free -m

Wed, 10/19/2011 - 04:29
neorf

i've total: 768 used: 391 free: 376

Now everything seems good... i hope ;-) Thanks

Sun, 10/23/2011 - 11:28
neorf

Today again the error, i've found webmin and mysql stopped. None error in /var/log/mysql.err and in miniserv.err i've found again the error: Temp file clearing is not done for the custom directory /var/tmp How could i fix it? Then, could be that mysql fills the /tmp dir and so something go wrong? doing df -h i get:

Filesystem            Size  Used Avail Use% Mounted on
/dev/hdv1             5.0G  1.8G  3.3G  35% /
none                   16M  352K   16M   3% /tmp

and i can't change the mount point...

Thanks

neorf

Mon, 10/24/2011 - 08:32
helpmin

I think it is most likely a memory issue. 768mb is kind of low especially if your VPS is based on OpenVZ and no swapfile (like in your case).

Mon, 10/24/2011 - 09:42
andreychek

Yeah, I agree with helpmin -- I don't think temp file clearing is related to why MySQL is crashing.

You could try stopping some of the services you aren't using in order to free up memory -- there's documentation on that here:

http://www.virtualmin.com/documentation/system/low-memory

Tue, 10/25/2011 - 08:18
neorf

ok, i've been able to record the error, this is error in mysqld.error

111025 12:12:31 [Note] /usr/sbin/mysqld: Normal shutdown

111025 12:12:31 [Note] Event Scheduler: Purging the queue. 0 events
111025 12:12:31  InnoDB: Starting shutdown...
111025 12:12:34 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
111025 12:12:34 [Warning] '--log' is deprecated and will be removed in a future release. Please use ''--general_log'/'--general_log_file'' instead.
111025 12:12:34 [Warning] '--log_slow_queries' is deprecated and will be removed in a future release. Please use ''--slow_query_log'/'--slow_query_log_file'' instead.
111025 12:12:34 [Warning] option 'thread_stack': unsigned value 65536 adjusted to 131072
111025 12:12:34 [Note] Plugin 'FEDERATED' is disabled.
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
111025 12:12:34  InnoDB: Retrying to lock the first data file
InnoDB: Unable to lock ./ibdata1, error: 11
InnoDB: Check that you do not already have another mysqld process
InnoDB: using the same InnoDB data or log files.
111025 12:12:36  InnoDB: Started; log sequence number 0 856421
111025 12:12:36 [Note] Event Scheduler: Loaded 0 events
111025 12:12:36 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.49-3-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Debian)
111025 12:12:36  InnoDB: Shutdown completed; log sequence number 0 856421
111025 12:12:36 [Note] /usr/sbin/mysqld: Shutdown complete

111025 12:12:36 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
Tue, 10/25/2011 - 08:28
neorf

Then i've found this on mysql.log

111025 12:12:31 3399 Connect debian-sys-maint@localhost on
3399 Quit
3400 Connect debian-sys-maint@localhost on
3400 Query SHOW VARIABLES LIKE 'pid_file'
3400 Shutdown
Tue, 10/25/2011 - 08:49
neorf

ok, so... i've noticed that, in mysqld.log, i've several:

  381 Connect Access denied for user 'snowboarding-live'@'localhost' (using password: YES)
  382 Connect Access denied for user 'snowboarding-live'@'localhost' (using password: YES)
  383 Connect Access denied for user 'snowboarding-live'@'localhost' (using password: YES)
  384 Connect Access denied for user 'snowboarding-live'@'localhost' (using password: YES)

and this makes mysql shutdown for something as "security"?

Tue, 10/25/2011 - 10:11
andreychek

Howdy,

MySQL won't shut down due to failed login attempts... that would be a too easy a way to cause a DoS :-)

As Helpmin mentioned, the low amount of RAM on your system is likely causing you to run into low-memory situations, which can cause intermittent failures in your daemons.

We can test for that though... what is the output of these two commands:

free -m
cat /proc/user_beancounters
Tue, 10/25/2011 - 10:42
neorf

so free -;

  total       used       free     shared    buffers     cached
Mem:           768        359        408          0          0          0
-/+ buffers/cache:        359        408
Swap:            0          0          0

then, cat /proc/user_beancounters, file not found. i'm not on openvz... but on linux vserver hypervisor.

Tue, 10/25/2011 - 11:20
andreychek

Well, although you're not using OpenVZ, it appears that you have a similar setup with no swap. So there's a very hard limit -- and if you happen to reach 768MB of RAM usage, processes will start being killed off.

If you run "dmesg | tail -30", do you see anything in there that shows any kernel errors?

You may also want to look in /var/log/kern.log as well, if you're indeed seeing memory issues, that kernel log may show the specifics there.

-Eric

Tue, 10/25/2011 - 11:28
neorf

ok thanks, but kern.log is empty and dmesg too... now i'm going to ask isp where can i find some log. For now i've setted up virtualmin to not load every modules, but just core modules.

My isp is offering KVM virtualization too... cold be better?

Thanks

neorf

Tue, 10/25/2011 - 12:06
andreychek

Well, that all depends on how it's setup... but having swap space is better than not having swap space :-)

-Eric

Tue, 10/25/2011 - 12:47
neorf

Ok, but why MySQL goes down, the webmin goes down too? Just due to low mem?

Tue, 10/25/2011 - 12:59
andreychek

Well, it's difficult to say with nothing in the logs, but your available memory is really suspicious -- and that's a common cause of the problem you're seeing.

If you haven't already, I'd recommend reading through the low memory guide, and disabling all the services you don't require.

-Eric

Tue, 10/25/2011 - 15:53
neorf

Ok thanks, i'm already doing it. According to you, why logs are empty? Again a server limitation? Thanks

Tue, 10/25/2011 - 17:34
andreychek

I'm really not sure why the kernel logs or your dmesg output is blank... my best guess there is that it's related to your VPS -- the kernel used with your VPS may not be producing that information.

-Eric

Topic locked