DB Credential code update
parent
c939c4a519
commit
87080506c0
|
@ -30,6 +30,7 @@ echo "Resetting the root password..."
|
|||
# Reset the root password in safe mode
|
||||
sudo mysql -u root <<EOF
|
||||
FLUSH PRIVILEGES;
|
||||
ALTER USER 'root'@'localhost' IDENTIFIED BY '$new_root_password';
|
||||
ALTER USER 'root'@'127.0.0.1' IDENTIFIED BY '$new_root_password';
|
||||
FLUSH PRIVILEGES;
|
||||
EOF
|
||||
|
@ -63,6 +64,9 @@ else
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Introduce a delay to allow MariaDB to fully initialize
|
||||
sleep 5
|
||||
|
||||
# Create MySQL database and user with the new root password
|
||||
echo "Creating MySQL database and user with the new root password..."
|
||||
mysql -u root -p"$new_root_password" <<EOF
|
||||
|
@ -104,4 +108,4 @@ if grep -q "$DB_NAME" "$WP_CONFIG" && grep -q "$DB_USER" "$WP_CONFIG" && grep -q
|
|||
else
|
||||
echo "Failed to update wp-config.php. Please check the file manually."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
Loading…
Reference in New Issue