MinUk.Dev
SQL - minuk dev wiki

SQL

created : Tue, 07 Apr 2020 20:34:32 +0900
modified : Sat, 26 Mar 2022 03:28:59 +0900

Mysql User Create

create user 'username'@'localhost' identified by 'password'

Grant privileges

grant all privileges on *.* to 'username'@'localhost';
grant all privileges on 'DBname'.* to 'username'@'localhost';

Drop User

drop user 'username'@'localhost';

Create Database

CREATE DATABASE 'DBname';

Create Table

CREATE TABLE table_name
(
column1 data_type(size),
column2 data_type(size),
column3 data_type(size),
...
)