Last active
August 1, 2021 06:35
-
-
Save holly/5b67127eefa9e39bee3524b26bad38f6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- for 5.6 | |
| -- UPDATE mysql.user SET Password=PASSWORD('your_password') WHERE User='root'; | |
| -- for generic | |
| -- ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_password'; | |
| -- for 5.7 | |
| -- UPDATE user SET authentication_string=PASSWORD('your_password') WHERE User='root'; | |
| -- for 8.0 | |
| INSTALL COMPONENT 'file://component_validate_password' | |
| SET GLOBAL validate_password.policy = 'LOW' | |
| ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_password'; | |
| DELETE FROM mysql.user WHERE User=''; | |
| DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1'); | |
| DROP DATABASE IF EXISTS test; | |
| DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'; | |
| FLUSH PRIVILEGES; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment