sql 파일 사용

오미희·2021년 12월 8일
0

database

목록 보기
1/1
//createtable.sql 파일

CREATE DATABASE page;
USE page;

CREATE TABLE board1(
    numbers int(11) not null AUTO_INCREMENT PRIMARY KEY,
    category VARCHAR(100),   
    subject VARCHAR(100) NOT NULL, 
    open_status varchar(10) NOT NULL,
    status varchar(20),  
    date DATETIME DEFAULT CURRENT_TIMESTAMP,  
    hit int(11),  
    content text,    
    product_category VARCHAR(50), 
    siteInfo VARCHAR(100)  
) AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;

-- 실행하는 법
--  mysql에 들어가서 source createtable.sql파일이 존재하는 경로입력
> source createtable.sql 파일 경로;
profile
안녕하세요

0개의 댓글