mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[doc] Be more verbose when reset the MySQL root password
This commit is contained in:
parent
aca251e981
commit
1430fa133a
2 changed files with 16 additions and 2 deletions
|
@ -26,6 +26,11 @@ do_post_regen() {
|
||||||
if [ $FORCE -eq 1 ]; then
|
if [ $FORCE -eq 1 ]; then
|
||||||
. /usr/share/yunohost/helpers.d/package
|
. /usr/share/yunohost/helpers.d/package
|
||||||
|
|
||||||
|
echo "It seems that you have already configured MySQL." \
|
||||||
|
"YunoHost needs to have a root access to MySQL to runs its" \
|
||||||
|
"applications, and is going to reset the MySQL root password." \
|
||||||
|
"You can find this new password in /etc/yunohost/mysql." >&2
|
||||||
|
|
||||||
# retrieve MySQL package provider
|
# retrieve MySQL package provider
|
||||||
ynh_package_is_installed "mariadb-server-10.0" \
|
ynh_package_is_installed "mariadb-server-10.0" \
|
||||||
&& mysql_pkg="mariadb-server-10.0" \
|
&& mysql_pkg="mariadb-server-10.0" \
|
||||||
|
@ -40,8 +45,12 @@ EOF
|
||||||
# reconfigure Debian package
|
# reconfigure Debian package
|
||||||
sudo dpkg-reconfigure -freadline -u "$mysql_pkg" 2>&1
|
sudo dpkg-reconfigure -freadline -u "$mysql_pkg" 2>&1
|
||||||
else
|
else
|
||||||
echo "MySQL password for root user has been manually changed" \
|
echo "It seems that you have already configured MySQL." \
|
||||||
"and will not be overridden without --force" >&2
|
"YunoHost needs to have a root access to MySQL to runs its" \
|
||||||
|
"applications, but the MySQL root password is unknown." \
|
||||||
|
"You must either pass --force to reset the password or" \
|
||||||
|
"put the current one into the file /etc/yunohost/mysql." >&2
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,11 @@ new_pwd=$(sudo cat "${backup_dir}/root_pwd" || sudo cat "${backup_dir}/mysql")
|
||||||
sudo mysqladmin -s -u root -p"$curr_pwd" password "$new_pwd" || {
|
sudo mysqladmin -s -u root -p"$curr_pwd" password "$new_pwd" || {
|
||||||
. /usr/share/yunohost/helpers.d/package
|
. /usr/share/yunohost/helpers.d/package
|
||||||
|
|
||||||
|
echo "It seems that you have already configured MySQL." \
|
||||||
|
"YunoHost needs to have a root access to MySQL to runs its" \
|
||||||
|
"applications, and is going to reset the MySQL root password." \
|
||||||
|
"You can find this new password in /etc/yunohost/mysql." >&2
|
||||||
|
|
||||||
# retrieve MySQL package provider
|
# retrieve MySQL package provider
|
||||||
ynh_package_is_installed "mariadb-server-10.0" \
|
ynh_package_is_installed "mariadb-server-10.0" \
|
||||||
&& mysql_pkg="mariadb-server-10.0" \
|
&& mysql_pkg="mariadb-server-10.0" \
|
||||||
|
|
Loading…
Add table
Reference in a new issue