Last active
May 20, 2016 03:41
-
-
Save mayurah/139eb04db35d94d9ce5fb3dfb932d069 to your computer and use it in GitHub Desktop.
Miscellaneous MySQL queries
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
# Random Rating Generator | |
INSERT INTO tbl_name ( rating ) VALUES ( ROUND(rand() * 5,2) ); | |
# Create user 'hackerearth' and password 'passphrase' | |
CREATE USER 'hackerearth'@'localhost' IDENTIFIED BY 'passphrase'; | |
# Grant superuser privileges to db 'test', user 'hackerearth', and hostname 'localhost' | |
GRANT ALL PRIVILEGES ON `test`.* TO 'hackerearth'@'localhost'; | |
# To see privilages related changes in effect. | |
FLUSH PRIVILEGES; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment