已解决
发布

在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’
仍是默认路径。

4 答案

发布
管理员 2017-02-11

报什么错误

#1
发布

报错信息是找不到/usr/local/mysql/bin/mysqld,实际路径为/opt/lnmp5/mysql/bin/mysqld。
经过多次重复调整安装,基本确认问题是mysql安装包选择二进制模式安装导致的路径不能完全变更,选址编译模式安装目录变更正常。

#2
发布
管理员 2017-02-12
sed -i 's@/usr/local/mysql@/opt/lnmp5/mysql@g' /opt/lnmp5/mysql/bin/mysqld_safe
#3
发布

在include/mysql-5.*.sh中添加2条
sed -i ‘s@/usr/local/mysql@/opt/lnmp5/mysql@g’ /etc/init.d/mysqld
sed -i ‘s@/usr/local/mysql@/opt/lnmp5/mysql@g’ /opt/lnmp5/mysql/bin/mysqld_safe
二进制和编译模式安装在没报错,问题解决,谢谢管理员。

#4

请登录或者 注册 来提交答案