권한,구조 관련 쿼리

유저 생성

1
use mysql;
  • 로컬 호스트 대신 ip 주소나 ‘%’ 와일드 카드 입력하여 접속 제한 설정
    1
    create user a@localhost identified by '1';
    

권한 부여

1
grant all privileges on *.* to 'root'@'%' identified by 'xxxx';
  • 적용
    1
    flush privileges;
    

스키마 생성

1
create database db_name;

스키마 선택

1
use shcema

구조 확인

schema

1
show databases;

table

1
show tables;

table 구조

1
DESC 테이블네임;