mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
added to mysql_secure_installation
changing root password on all hosts (bug 1228) scripts/mysql_secure_installation.sh: added changing root password on all hosts
This commit is contained in:
@@ -85,9 +85,13 @@ set_root_password() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
do_query "SET PASSWORD FOR root=PASSWORD('$password1');"
|
do_query "UPDATE mysql.user SET Password=PASSWORD('$password1') WHERE User='root';"
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "Password updated successfully!"
|
echo "Password updated successfully!"
|
||||||
|
echo "Reloading privilege tables.."
|
||||||
|
if ! reload_privilege_tables; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
echo
|
echo
|
||||||
rootpass=$password1
|
rootpass=$password1
|
||||||
make_config
|
make_config
|
||||||
@@ -144,11 +148,11 @@ reload_privilege_tables() {
|
|||||||
do_query "FLUSH PRIVILEGES;"
|
do_query "FLUSH PRIVILEGES;"
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo " ... Success!"
|
echo " ... Success!"
|
||||||
|
return 0
|
||||||
else
|
else
|
||||||
echo " ... Failed!"
|
echo " ... Failed!"
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interrupt() {
|
interrupt() {
|
||||||
|
Reference in New Issue
Block a user