Thesqld_safe version different than thesqld

MySQLmysqldmysqld-safe

Is it a problem that mysqld socket has a different version than the mysqld server?
I noticed this in my mysqld log during startup

120420 19:30:06 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
120420 19:30:06  InnoDB: Initializing buffer pool, size = 8.0M
120420 19:30:06  InnoDB: Completed initialization of buffer pool
120420 19:30:06  InnoDB: Started; log sequence number 0 44233
120420 19:30:06 [Note] Event Scheduler: Loaded 0 events
120420 19:30:06 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.61'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution

Yet, when I show variables I get this

SHOW VARIABLES LIKE "%version%";

+-------------------------+-------------------------------------------+
| Variable_name           | Value                                     |
+-------------------------+-------------------------------------------+
| innodb_version          | 5.5.30                                    |
| protocol_version        | 10                                        |
| slave_type_conversions  |                                           |
| version                 | 5.5.30-cll                                |
| version_comment         | MySQL Community Server (GPL) by Atomicorp |
| version_compile_machine | x86_64                                    |
| version_compile_os      | Linux                                     |
+-------------------------+-------------------------------------------+
7 rows in set (0.00 sec)

Based on golimar's questions I ran a

ps aux

and I see this

mysql 633 31.4 33.5 11942788 5452172 ? SNl 08:18 101:31
/usr/libexec/mysqld –basedir=/usr –datadir=/var/lib/mysql
–plugin-dir=/usr/lib64/mysql/plugin –user=mysql –log-error=/var/lib/mysql/host.reviewcritical.com.err –open-files-limit=4096 –pid-file=/var/run/mysqld/mysqld.pid –socket=/var/lib/mysql/mysql.sock –port=3306

root 32674 0.0 0.0 108292 1576 ? SN 08:18 0:00
/bin/sh /usr/bin/mysqld_safe –datadir=/var/lib/mysql
–socket=/var/lib/mysql/mysql.sock –pid-file=/var/run/mysqld/mysqld.pid –basedir=/usr –user=mysql

Best Answer

As we all know, mysqld_safe and mysqld are very different

mysqld : The database server instance daemon

mysqld_safe : Control program that examines and sets the environment for mysqld to execute. The mysqld executable is actually launched in a loop. When mysqld terminates, the mysqld_safe program will examine the return results and decide whether

  • mysqld terminated normally (intentional shutdown), leaves mysqld_safe
  • mysqld terminated abnormally (crash or kill -9 of mysqld)
    • Loop back, mysqld fails on retry, leaves mysqld_safe
    • Loop back, mysqld starts up, stays in the mysqld_safe loop

Why is it important to have mysqld and mysqld_safe using the same MySQL version?

Let me illustrate it this way: Percona Server sometimes has additional features in mysqld_safe for manipulating the OS. For example, I have seen numactl --interleave=all in a Percona Server mysqld_safe. If that line was not there, the mysqld for Percona Server may run into issues with memory and swapping.

The same scenario could possibly be the case for Oracle's (ugh, still hate saying that) mysqld and mysqld_safe. There could be improvements from one major release to another that would be removed if the mysqld_safe was older.

Rather than exploring the possibilities of using a old mysqld_safe and a new mysqld (or vica versa), please make your life simple and reinstall MySQL 5.5.30 from scratch.

Before doing so, please run

updatedb
locate mysqld_safe

in Linux and see if there are two lingering. If there are, get the paths straightened out. Otherwise, you may have to reinstall MySQL 5.5.30.