mysql regenconf: Get rid of confusing 'Access denied' message

This commit is contained in:
Alexandre Aubin 2021-04-13 14:18:49 +02:00 committed by GitHub
parent b33e7c16ac
commit d1f0064b10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,7 +37,7 @@ do_post_regen() {
# This is a trick to check if we're able to use mysql without password
# Expect instances installed in stretch to already have unix_socket
#configured, but not old instances from the jessie/wheezy era
if ! echo "" | mysql
if ! echo "" | mysql 2>/dev/null
then
password="$(cat /etc/yunohost/mysql)"
# Enable plugin unix_socket for root on localhost
@ -45,7 +45,7 @@ do_post_regen() {
fi
# If now we're able to login without password, drop the mysql password
if echo "" | mysql
if echo "" | mysql 2>/dev/null
then
rm /etc/yunohost/mysql
else