最近一直忙mysql的问题。换了一台服务器,发现mysql启动有问题,这台服务器的mysql之前有人动过。服务器系统是Mac os ,安装包用的是rpm包。我看修改过mysql安装目录。配置文件也改变了很多。我重启的时候出现了此问题。
MySQL manager or server PID file could not be found!       [FAILED]
Starting MySQL....................................................................................................Manager of pid-file quit without updating file.     [FAILED]
真不知,如何修改,两天又过去了。这是mysql的配置文件my.cnf部分配置:
[mysqld]
#basedir=/usr/local/mysql
#datadir=/usr/local/mysql/data
user=mysql
basedir=/usr
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
#...............
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid我再贴一下mysql的启动脚本init.d/mysql文件,部分内容:
# If you want to affect other MySQL variables, you should make your changes
# in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files.# If you change base dir, you must also change datadir. These may get
# overwritten by settings in the MySQL configuration files.basedir=
datadir=# The following variables are only set for letting mysql.server find things.# Set some defaultspid_file=
server_pid_file=
use_mysqld_safe=1
user=mysql
if test -z "$basedir"
then
  basedir=/var/lib/mysql
  bindir=./bin
  if test -z "$datadir"
  then
    datadir=/var/lib/mysql
  fi
  sbindir=./bin
  libexecdir=./bin
else
  bindir="$basedir/bin"
  if test -z "$datadir"
  then
    datadir="$basedir/data"
  fi
  sbindir="$basedir/sbin"
  libexecdir="$basedir/libexec"
fi# If the manager pid_file doesn't exist, try the server's
if test -s "$pid_file"
    then
      mysqlmanager_pid=`cat $pid_file`
      echo $echo_n "Shutting down MySQL"
      kill $mysqlmanager_pid
      # mysqlmanager should remove the pid_file when it exits, so wait for it.
      wait_for_pid removed "$mysqlmanager_pid"; return_value=$?      # delete lock for RedHat / SuSE
      if test -f $lock_dir
      then
        rm -f $lock_dir
      fi
      exit $return_value
    else
      log_failure_msg "MySQL manager or server PID file could not be found!"
    fi
    ;;通过,上面可以看出pid_file变量不对,不知到咋修改.