USER 권한 관리/DATABASE 관리
create database ____; 만들기
show databases; 보기
drop database ___; 지우기
SELECT User, Host FROM user;
create user 'zerobase'@'%'identified by'5678'; 외부 접속 가능 계정
create user'zerobase'@'localhost'identified by'1234'; 내부 local 접속 가능 계정
<유저 권한 관리 >
create user 'zerobase'@'localhost'identified by'1234'; localhost 계정 생성
select host,user from user;
show grants for 'zerobase'@'localhost'; 계정 권한 보기
grant all on testdb.*to'zerobase'@'localhost'; testdb 권한 모두 zerobase에게 주기
revoke all on testdb.*from'zerobase'@'localhost'; 모든 권한 지우기
TABLE 생성
create database zerobase default character set utf8mb4;
use zerobase;
create table mytable #테이블 생성
-> (
-> id int,
-> name varchar(16)
-> );
desc mytable; #테이블 보기
alter table mytable rename person; #table 이름 바꾸기
alter table person add column agee double; # 행 집어넣기
alter table person modify column age int; # 자료형 바꾸기
alter table person change column agee age int; #이름 바꾸기
alter table person drop column age;#행 삭제하기