mysql
mysql 게시판 CRUD 기초 강좌 - 테스트를 위한 대량의 데이터 입력
에스크리토
2022. 1. 10. 17:24
반응형
insert into board (`userid`, `subject`, `content`, `regdate`, `status`)
select userid, concat("제목_",right(rand(),6)), concat(content,"_",right(rand(),6)), now(), status from board;
이런식으로 해주면 서로 다른 제목으로 많은 데이터를 입력할 수 있다.
한 10번 반복하면 테스트용으로 충분할것이다.
insert into board (`userid`, `subject`, `content`, `regdate`, `status`)
select 'dong', subject, content, now(), status from board;
아이디만 다른 데이터도 넣자.
위 쿼리로 데이터를 많이 만들어놓고 테스트 해보자.
반응형