mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-17658 change the structure of mysql.user table
Implement User_table_json. Fix scripts to use mysql.global_priv. Fix tests.
This commit is contained in:
@ -304,7 +304,7 @@ set_root_password() {
|
||||
fi
|
||||
|
||||
esc_pass=`basic_single_escape "$password1"`
|
||||
do_query "UPDATE mysql.user SET Password=PASSWORD('$esc_pass') WHERE User='root';"
|
||||
do_query "UPDATE mysql.global_priv SET priv=json_set(priv, '$.plugin', 'mysql_native_password', '$.authentication_string', PASSWORD('$esc_pass')) WHERE User='root';"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Password updated successfully!"
|
||||
echo "Reloading privilege tables.."
|
||||
@ -324,7 +324,7 @@ set_root_password() {
|
||||
}
|
||||
|
||||
remove_anonymous_users() {
|
||||
do_query "DELETE FROM mysql.user WHERE User='';"
|
||||
do_query "DELETE FROM mysql.global_priv WHERE User='';"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo " ... Success!"
|
||||
else
|
||||
@ -336,7 +336,7 @@ remove_anonymous_users() {
|
||||
}
|
||||
|
||||
remove_remote_root() {
|
||||
do_query "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
|
||||
do_query "DELETE FROM mysql.global_priv WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');"
|
||||
if [ $? -eq 0 ]; then
|
||||
echo " ... Success!"
|
||||
else
|
||||
|
Reference in New Issue
Block a user