mysql crashing & crashing

milan

Verified User
Joined
Dec 29, 2005
Messages
78
Since I have installed zend optimizer my mysql freezes. Past week i had to reboot sometimes but now i wont want to reboot. (my server hoster complained about the load of reboots.) I dont know if its a problem of zendoptimizer.

im using a debian box


Code:
server1:~# /etc/init.d/mysql restart 
-su: /etc/init.d/mysql: No such file or directory
server1:~# /etc/init.d/mysqld restart 
Stopping mysqld:                [ FAILED ]
Starting mysqld:                [ OK ]
server1:~# /etc/init.d/mysqld killal 

Usage: mysqld { start | stop | restart }

server1:~# /etc/init.d/mysqld stop   
Stopping mysqld:                [ FAILED ]
server1:~# /etc/init.d/mysqld stop
Stopping mysqld:                [ FAILED ]
server1:~# mysqld killal 
-su: mysqld: command not found
server1:~# killal mysql
-su: killal: command not found
server1:~# killal mysqld
-su: killal: command not found
server1:~# killall mysql 
mysql: no process killed
server1:~# killall mysql -9
mysql: no process killed
server1:~# killall -9  mysql   
mysql: no process killed
server1:~# killall -9  mysql
mysql: no process killed
server1:~# /etc/init.d/mysqld restart 
Stopping mysqld:                [ FAILED ]
Starting mysqld:                [ OK ]
server1:~# /usr/local/directadmin/conf/mysql.conf
-su: /usr/local/directadmin/conf/mysql.conf: Permission denied
server1:~# killall -9 mysqld
server1:~# /etc/init.d/mysqld restart 
Stopping mysqld:                [ FAILED ]
Starting mysqld:                [ OK ]
server1:~# /var/log/messages
-su: /var/log/messages: Permission denied
server1:~# cd /var/log/        
server1:/var/log# messages
-su: messages: command not found
server1:/var/log# ls
aptitude               debug.2.gz     lp-errs.3.gz    messages.3.gz
aptitude.1.gz          debug.3.gz     lp-errs.4.gz    news
auth.log               directadmin    lpr.log         proftpd
auth.log.0             dmesg          lpr.log.0       syslog
auth.log.1.gz          exim           lpr.log.1.gz    syslog.0
auth.log.2.gz          httpd          lpr.log.2.gz    syslog.1.gz
auth.log.3.gz          kern.log       lpr.log.3.gz    syslog.2.gz
auth.log.4.gz          kern.log.0     mail.err        syslog.3.gz
auth.log.5.gz          kern.log.1.gz  mail.info       syslog.4.gz
auth.log.6.gz          kern.log.2.gz  mail.info.0     syslog.5.gz
base-config.log.1      kern.log.3.gz  mail.info.1.gz  syslog.6.gz
base-config.timings.1  ksymoops       mail.info.2.gz  user.log
btmp                   lastlog        mail.info.3.gz  user.log.0
btmp.1                 lp-acct        mail.log        user.log.1.gz
daemon.log             lp-acct.0      mail.log.0      user.log.2.gz
daemon.log.0           lp-acct.1.gz   mail.log.1.gz   user.log.3.gz
daemon.log.1.gz        lp-acct.2.gz   mail.log.2.gz   uucp.log
daemon.log.2.gz        lp-acct.3.gz   mail.log.3.gz   wtmp
daemon.log.3.gz        lp-acct.4.gz   mail.warn       wtmp.1
debian-installer       lp-errs        messages        xferlog
debug                  lp-errs.0      messages.0
debug.0                lp-errs.1.gz   messages.1.gz
debug.1.gz             lp-errs.2.gz   messages.2.gz
server1:/var/log# cd messages
-su: cd: messages: Not a directory
server1:/var/log# pico messages
server1:/var/log# cd ~
-su: cd: ?~: No such file or directory
server1:/var/log# cd ~
server1:~# killall safemysqld
safemysqld: no process killed
server1:~# killall safemysqld
safemysqld: no process killed
server1:~# killall -9 mysqld safe_mysqld
safe_mysqld: no process killed
server1:~# ps -e | grep mysqld
26400 ?        00:00:00 mysqld_safe
 9130 ?        00:00:00 mysqld
 9131 ?        00:00:00 mysqld
 9132 ?        00:00:00 mysqld
 9133 ?        00:00:00 mysqld
 9134 ?        00:00:00 mysqld
 9135 ?        00:00:00 mysqld
 9136 ?        00:00:00 mysqld
 9137 ?        00:00:00 mysqld
 9138 ?        00:00:00 mysqld
 9139 ?        00:00:00 mysqld
server1:~# find / | grep mysql.sock
/tmp/mysql.sock
server1:~# kill 26400
server1:~# ps -e | grep mysqld
26400 ?        00:00:00 mysqld_safe
 9130 ?        00:00:00 mysqld
 9131 ?        00:00:00 mysqld
 9132 ?        00:00:00 mysqld
 9133 ?        00:00:00 mysqld
 9134 ?        00:00:00 mysqld
 9135 ?        00:00:00 mysqld
 9136 ?        00:00:00 mysqld
 9137 ?        00:00:00 mysqld
 9138 ?        00:00:00 mysqld
 9139 ?        00:00:00 mysqld
server1:~# killall safemysqld
safemysqld: no process killed
server1:~# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
server1:~# /etc/init.d/mysqld restart 
Stopping mysqld:                [ FAILED ]
Starting mysqld:                [ OK ]
server1:~# kill mysqld
-su: kill: mysqld: no such pid
server1:~# ps
  PID TTY          TIME CMD
 8849 pts/0    00:00:00 bash
 9288 pts/0    00:00:00 ps
server1:~# top

top - 12:44:14 up 2 days, 22:18,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:  55 total,   1 running,  54 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0% us,  0.0% sy,  0.0% ni, 100.0% id,  0.0% wa,  0.0% hi,  0.0% si
Mem:    451968k total,   424048k used,    27920k free,    36580k buffers
Swap:   562232k total,        0k used,   562232k free,   336400k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
    1 root      16   0  1504  512 1352 S  0.0  0.1   0:00.83 init               
    2 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0        
    3 root       5 -10     0    0    0 S  0.0  0.0   0:03.64 events/0           
    4 root       8 -10     0    0    0 S  0.0  0.0   0:00.00 khelper            
    5 root      14 -10     0    0    0 S  0.0  0.0   0:00.00 kacpid             
   44 root       5 -10     0    0    0 S  0.0  0.0   0:00.23 kblockd/0          
   54 root      15   0     0    0    0 S  0.0  0.0   0:00.15 pdflush            
   55 root      15   0     0    0    0 S  0.0  0.0   0:00.48 pdflush            
   57 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 aio/0              
   56 root      15   0     0    0    0 S  0.0  0.0   0:01.55 kswapd0            
  199 root      25   0     0    0    0 S  0.0  0.0   0:00.00 kseriod            
  301 root      15   0     0    0    0 S  0.0  0.0   0:03.04 kjournald          
  718 root       6 -10     0    0    0 S  0.0  0.0   0:00.00 ata/0              
  719 root      20   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_0          
  720 root      20   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_1          
  819 root      15   0     0    0    0 S  0.0  0.0   0:00.00 khubd              
 1252 root      25   0     0    0    0 S  0.0  0.0   0:00.00 pciehpd_event      
top - 12:44:19 up 2 days, 22:19,  1 user,  load average: 0.00, 0.00, 0.00
Tasks:  55 total,   2 running,  53 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0% us,  0.0% sy,  0.0% ni, 100.0% id,  0.0% wa,  0.0% hi,  0.0% si
Mem:    451968k total,   424040k used,    27928k free,    36588k buffers
Swap:   562232k total,        0k used,   562232k free,   336400k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
    1 root      16   0  1504  512 1352 S  0.0  0.1   0:00.83 init               
    2 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0        
    3 root       5 -10     0    0    0 S  0.0  0.0   0:03.64 events/0           
    4 root       8 -10     0    0    0 S  0.0  0.0   0:00.00 khelper            
    5 root      14 -10     0    0    0 S  0.0  0.0   0:00.00 kacpid             
   44 root       5 -10     0    0    0 S  0.0  0.0   0:00.23 kblockd/0          
   54 root      15   0     0    0    0 S  0.0  0.0   0:00.15 pdflush            
   55 root      15   0     0    0    0 S  0.0  0.0   0:00.48 pdflush            
   57 root       5 -10     0    0    0 S  0.0  0.0   0:00.00 aio/0              
   56 root      15   0     0    0    0 S  0.0  0.0   0:01.55 kswapd0            
  199 root      25   0     0    0    0 S  0.0  0.0   0:00.00 kseriod            
  301 root      15   0     0    0    0 S  0.0  0.0   0:03.04 kjournald          
  718 root       6 -10     0    0    0 S  0.0  0.0   0:00.00 ata/0              
  719 root      20   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_0          
  720 root      20   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_1          
  819 root      15   0     0    0    0 S  0.0  0.0   0:00.00 khubd              
 1252 root      25   0     0    0    0 S  0.0  0.0   0:00.00 pciehpd_event      
server1:~# /etc/init.d/mysqld restart 
Stopping mysqld:                [ FAILED ]
Starting mysqld:                [ OK ]
server1:~# /etc/init.d/mysqld restart 
Stopping mysqld:                [ FAILED ]
Starting mysqld:                [ OK ]
server1:~# killal mysqld
-su: killal: command not found
server1:~# kil mysqld
-su: kil: command not found
server1:~# kill mysqld
-su: kill: mysqld: no such pid
server1:~# /etc/init.d/mysqld start  
Starting mysqld:                [ OK ]
server1:~# ps -e | grep mysqld
26400 ?        00:00:00 mysqld_safe
 9130 ?        00:00:00 mysqld
 9131 ?        00:00:00 mysqld
 9132 ?        00:00:00 mysqld
 9133 ?        00:00:00 mysqld
 9134 ?        00:00:00 mysqld
 9135 ?        00:00:00 mysqld
 9136 ?        00:00:00 mysqld
 9137 ?        00:00:00 mysqld
 9138 ?        00:00:00 mysqld
 9139 ?        00:00:00 mysqld
server1:~# find / | grep mysql.sock
server1:~# find / | grep mysql.sock
server1:~# find / | grep my.cnf    
server1:~# /tmp/mysql.sock
-su: /tmp/mysql.sock: No such file or directory
server1:~# pico /tmp/mysql.sock
server1:~ /etc/my.cnf
-su: /etc/my.cnf: No such file or directory
server1:~# /etc/my.cnf
-su: /etc/my.cnf: No such file or directory
server1:~# pico /etc/my.cnf
server1:~# /usr/local/directadmin/conf/mysql.conf
-su: /usr/local/directadmin/conf/mysql.conf: Permission denied
server1:~# ./etc/my.cnf
-su: ./etc/my.cnf: No such file or directory
server1:~# /etc/.my.cnf
-su: /etc/.my.cnf: No such file or directory
server1:~# exir
-su: exir: command not found
server1:~# exit
logout
admin@server1:~$ mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
admin@server1:~$ mysqld
-bash: mysqld: command not found
admin@server1:~$ mysqld restart
-bash: mysqld: command not found
admin@server1:~$ mysql restart
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
admin@server1:~$
 
Okey i killed all mysql ids
but i would love to fix the original error/bug.

could anyone help me with this?

Code:
server1:~# ps -e | grep mysqld
26400 ?        00:00:00 mysqld_safe
 9130 ?        00:00:00 mysqld
 9131 ?        00:00:00 mysqld
 9132 ?        00:00:00 mysqld
 9133 ?        00:00:00 mysqld
 9134 ?        00:00:00 mysqld
 9135 ?        00:00:00 mysqld
 9136 ?        00:00:00 mysqld
 9137 ?        00:00:00 mysqld
 9138 ?        00:00:00 mysqld
 9139 ?        00:00:00 mysqld
server1:~# kill 26400
server1:~# kill 9130 
server1:~# kill 9131
server1:~# kill 9132
server1:~# kill 9133
server1:~# kill 9134
server1:~# kill 9135
server1:~# kill 9136
server1:~# kill 9137
server1:~# kill 9138
server1:~# kill 9139
server1:~# ps -e | grep mysqld
server1:~# /etc/init.d/mysqld start
Starting mysqld:                [ OK ]
 
There's an optimization configuration file for mysql in the DirectAdmin knowledge base; look here.

I don't know why your hosting company is complaining about the reboots, unless you've lost control of your server and have to ask them to power-cycle it.

If so, just ask them to install web-based power switches :) .

Jeff
 
Hi
I have the same problem.
Here again this is what I sometimes get while trying to restart mysqld:
Stopping mysqld: [ FAILED ]
Starting mysqld: [ OK ]
Why is "A mysqld process already exists at ..." in my mysqld.log ?
I hope somebody can tell me why this happens. :confused:
 
Hello,

This is debian? When mysqld is being "stopped", a signal is sent to mysql to stop. The action that sends the signal is done almost instantly and returns to it's calling script right away. The mysql process, upon receiving the signal takes a few seconds to actually stop.

So with a "Restart" command, if no pause is taken after the stop and before the start, then you'll hit "it's already running" error, because the start has occurred before the stop is actually finish.. so the start fails... then after, the stop finish, leaving you with no mysql.

If you edit /etc/init.d/mysqld, you'll see this bit of code
Code:
        restart)
                $0 stop
                $0 start
                ;;
Change it to look like
Code:
        restart)
                $0 stop
                sleep 4
                $0 start
                ;;
So that mysql has a few moments to actually come to a full/safe stop before the startup is attempted.

John
 
Hi John,
Thank you very much for your reply.
DirectAdmin Support said:
This is debian?
Yes, it's a debian box.
DirectAdmin Support said:
Change it to look like
Code:
        restart)
                $0 stop
                sleep 4
                $0 start
                ;;
I had to change it to
Code:
        restart)
                $0 stop
                [B]sleep 10[/B]
                $0 start
                ;;
to make it work for me.
I'll keep an eye on the server to see if anything goes wrong.
 
Hi,
Mysql got choked up again!
I have attached a snapshot of the Service Monitor page.
I looked at /var/log/mysqld.log and :
Code:
060422 09:49:00  mysqld ended

060422 09:49:36  mysqld started
060422  9:49:36 [ERROR] Can't start server: Bind on TCP/IP port: Address already in use
060422  9:49:36 [ERROR] Do you already have another mysqld server running on port: 3306 ?
060422  9:49:36 [ERROR] Aborting
What is wrong here?! I would do anything to solve this problem.
The funny thing is that you can't stop mysqld!
Here's a snapshot of the shell commands: (see for yourself)
Code:
host:/home/internet# /etc/init.d/mysqld restart
Stopping mysqld:                [ FAILED ]
Starting mysqld:                [ OK ]
host:/home/internet# mysql -u da_admin -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
host:/home/internet# ps -C mysqld
  PID TTY          TIME CMD
 7629 pts/0    00:00:00 mysqld
 7636 pts/0    00:00:00 mysqld
 7637 pts/0    00:00:00 mysqld
 7682 pts/0    00:00:00 mysqld
 7683 pts/0    00:00:00 mysqld
 7684 pts/0    00:00:00 mysqld
 7685 pts/0    00:00:00 mysqld
 7686 pts/0    00:00:00 mysqld
 7687 pts/0    00:00:00 mysqld
 7688 pts/0    00:00:00 mysqld
 7689 pts/0    00:00:00 mysqld
 7690 pts/0    00:00:00 mysqld
 7691 pts/0    00:00:00 mysqld
 7692 pts/0    00:00:00 mysqld
 7693 pts/0    00:00:00 mysqld
 7694 pts/0    00:00:00 mysqld
 7697 pts/0    00:00:00 mysqld
 7702 pts/0    00:00:00 mysqld
 7704 pts/0    00:00:00 mysqld
 7706 pts/0    00:00:00 mysqld
 7708 pts/0    00:00:00 mysqld
 7709 pts/0    00:00:00 mysqld
 7710 pts/0    00:00:00 mysqld
 7711 pts/0    00:00:00 mysqld
 7713 pts/0    00:00:00 mysqld
 7714 pts/0    00:00:00 mysqld
 7715 pts/0    00:00:00 mysqld
 7716 pts/0    00:00:00 mysqld
 7718 pts/0    00:00:00 mysqld
 7719 pts/0    00:00:00 mysqld
host:/home/internet# kill 7629 7636 7637 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7697 7702 7704 7706 7708 7709 7710 7711 7713 7714 7715 7716 7718 7719
host:/home/internet# ps -C mysqld
  PID TTY          TIME CMD
host:/home/internet# /etc/init.d/mysqld start
Starting mysqld:                [ OK ]
host:/home/internet# mysql -u da_admin -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 4.1.10-standard-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
 

Attachments

  • services.jpg
    services.jpg
    66.3 KB · Views: 257
Problem solved! :D
Just for the record, this is how:
I added 'SET NAMES utf8' to my applications.
I had it also in my.cnf but for some reason it didn't work.
Remember, if you have the same problem, you need to run it before running any queries on mysql.(your encoding may vary though)

Cheers all ;)
Now happy and relieved,
Payman
 
Back
Top