Created
September 29, 2011 20:28
-
-
Save jachin/1251832 to your computer and use it in GitHub Desktop.
MySQL Cheat Sheet
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
# Create database. | |
CREATE DATABASE some_database_name; | |
# Create a user with all the priviliges for the database. | |
GRANT ALL PRIVILEGES ON some_database_name.* TO some_user@'localhost' IDENTIFIED BY 'some_pass' WITH GRANT OPTION; | |
# Make sure our changes will get used. | |
FLUSH PRIVILEGES; | |
# Sorting in descending order. | |
SELECT * FROM a ORDER BY a.a DESC | |
# Sorting in ascending order. | |
SELECT * FROM a ORDER BY a.a ASC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment