mysql修改安装路径,安装好后不能启动,mysqld和mysql_safe中路径错误

问答中心分类: Databasemysql修改安装路径,安装好后不能启动,mysqld和mysql_safe中路径错误
lxy126 提问 10月 前

在options.conf中修改了mysql的安装路径,运行install.sh进行安装,安装好后不能启动mysql,新目录为/opt/lnmp5/mysql和/opt/lnmp5/mysql_data,参看my.cnf和mysqld_safe、mysqld3个文件,发现在mysqld中,basedir=/opt/lnmp5/mysql ;datadir=/opt/lnmp5/mysql_data,但是
mysqld_pid_file_path=
if test -z “$basedir”
then
basedir=/usr/local/mysql
bindir=/usr/local/mysql/bin
if test -z “$datadir”
then
datadir=/usr/local/mysql/data
fi
sbindir=/usr/local/mysql/bin
libexecdir=/usr/local/mysql/bin
仍然是默认路径,同样在mysqld_safe中,basedir=/opt/lnmp5/mysql ;datadir=/opt/lnmp5/mysql_data,

if echo ‘/usr/local/mysql/share’ | grep ‘^/usr/local/mysql’ > /dev/null
then
relpkgdata=`echo ‘/usr/local/mysql/share’ | sed -e ‘s,^/usr/local/mysql,,’ -e ‘s,^/,,’ -e ‘s,^,./,’`
else
# pkgdatadir is not relative to prefix
relpkgdata=’/usr/local/mysql/share’
fi
case “$0” in
/*)
MY_PWD=’/usr/local/mysql’
仍是默认路径。