Created
August 20, 2020 11:50
-
-
Save gbarreiro/88a2c81ec20cea3c59765efd6c94a784 to your computer and use it in GitHub Desktop.
MySQL cheatsheet: create a database and assign permissions to users
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
-- Create the database | |
CREATE DATABASE University; | |
-- Use a database | |
USE University; | |
-- Assign permissions to a database | |
GRANT ALL ON University TO mike | |
GRANT INSERT, UPDATE ON University.Students TO william | |
GRANT SELECT(id, name) ON University.Teachers TO john | |
-- Remove a database | |
DROP DATABASE University; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment