Kudos
Collect
Twiiter
Facebook
Share
Develop somethings, meditation, reading and thinking...

MySQL 테이블 복사하기

Last updated over 4 years ago
1 0 0 0

테이블의 구조를 (인덱스 등) 포함하여 그대로 테이블을 복사하는 방법.

1. 복사할 테이블 생성

우선 기존의 테이블 구조를 그대로 가져와 새로운 테이블을 만들고,

CREATE TABLE new_table_name LIKE old_table_name;

2. 데이터 삽입

새로운 테이블에 기존 테이블의 데이터를 삽입.

INSERT INTO new_table_name SELECT * FROM old_table_name;

이렇게 하면 테이블 구조까지 그대로 복사할 수 있다.

Hi, my name is Richard. I’m a developer wants to make the world better with logic power. Mainly I use Linux, Nginx, MySQL, PHP and JavaScript . I want to share my knowledge with someone that it was also based from some great persons via LYNMP. 👨‍💻

Essedrop - Make your file online instantly
 

Responses

Leave a response to @richard

Please sign in to comment.
Markdown is also available in comment.