Last active
June 2, 2022 01:03
-
-
Save hucancode/951208d1a307a66081f1e1be61a12e77 to your computer and use it in GitHub Desktop.
Create a database and an user associated with it
This file contains 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
mysql -uroot -p -e "CREATE DATABASE mydb;CREATE USER myuser@'%' IDENTIFIED BY 'secret';GRANT ALL PRIVILEGES ON mydb.* TO myuser@'%';" |
This file contains 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
# run these if you got kicked by mysql password policy | |
/* | |
set global validate_password.policy = LOW; | |
set global validate_password.length = 2; | |
set global validate_password.mixed_case_count = 0; | |
set global validate_password.number_count = 0; | |
set global validate_password.special_char_count = 0; | |
*/ | |
CREATE DATABASE mydb; | |
CREATE USER myuser@'%' IDENTIFIED BY 'secret'; | |
GRANT ALL PRIVILEGES ON mydb.* TO myuser@'%'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment