2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 14:57:16 +08:00

refactor: MySQL改密逻辑

This commit is contained in:
耗子
2024-06-24 21:52:46 +08:00
parent 7b80f034ea
commit dfa14c3fd4
8 changed files with 317 additions and 142 deletions

View File

@@ -287,8 +287,8 @@ chmod 644 ${mysqlPath}/conf/my.cnf
${mysqlPath}/bin/mysqld --initialize-insecure --user=mysql --basedir=${mysqlPath} --datadir=${mysqlPath}/data
echo "export PATH=${mysqlPath}/bin:\$PATH" >> /etc/profile.d/mysql.sh
source /etc/profile
# 软链接
ln -sf ${mysqlPath}/bin/* /usr/bin/
# 写入 systemd 配置
cat > /etc/systemd/system/mysqld.service << EOF

View File

@@ -34,9 +34,6 @@ rm -f /usr/lib64/libmysql*
userdel -r mysql
groupdel mysql
rm -f /etc/profile.d/mysql.sh
source /etc/profile
panel deletePlugin mysql${1}
echo -e "${HR}\nMySQL-${1} 卸载完成\n${HR}"

View File

@@ -120,6 +120,9 @@ chown -R mysql:mysql ${mysqlPath}
chmod -R 755 ${mysqlPath}
chmod 644 ${mysqlPath}/conf/my.cnf
# 软链接
ln -sf ${mysqlPath}/bin/* /usr/bin/
# 启动服务
systemctl start mysqld

View File

@@ -133,6 +133,16 @@ if version_lt "$oldVersion" "2.2.14"; then
fi
fi
if version_lt "$oldVersion" "2.2.16"; then
echo "更新面板到 v2.2.16 ..."
echo "Update panel to v2.2.16 ..."
if [ -f "/www/server/mysql/bin/mysql" ]; then
ln -sf /www/server/mysql/bin/* /usr/bin/
rm -f /etc/profile.d/mysql.sh
source /etc/profile
fi
fi
echo $HR
echo "更新结束"
echo "Update finished"