mysql ready reckoner cheatsheet

Create a database:

CREATE DATABASE appointments;

Use the created database:

USE appointments;

Create a user and grant him privileges to any database:

CREATE USER 'appointmentusr'@'localhost' IDENTIFIED BY 'arOcosIHPVJ78jBY66qu';
GRANT ALL PRIVILEGES ON appointments.* TO 'appointmentusr'@'localhost';

Create Table:

CREATE TABLE `appointments`.`customers` ( `cstID` INT NOT NULL , `Name` TEXT NOT NULL , `Age` INT NOT NULL , `Mobile` INT NOT NULL ) ENGINE = InnoDB;

Change password for user:

ALTER USER [email protected] IDENTIFIED BY 'arOcoaasdHPVJ78jBY66qu';