Changing a database table prefix is easy and here’s the simple step-by-step guide! For WordPress installations, it’s essential!
database_name
, old_prefix_
and new_prefix_
to the required values:SET @database = "database_name" ; SET @old_prefix = "old_prefix_" ; SET @new_prefix = "new_prefix_" ; SELECT concat( "RENAME TABLE " , TABLE_NAME, " TO " , replace(TABLE_NAME, @old_prefix, @new_prefix), ';' ) AS "SQL" FROM information_schema.TABLES WHERE TABLE_SCHEMA = @database; |
If your database doesn’t have a prefix at all, follow the steps above but use the below query that’s been slightly modified for this purpose:
SET @database = "database_name" ; SET @prefix = "prefix_" ; SELECT concat( "RENAME TABLE " , TABLE_NAME, " TO " , @prefix, TABLE_NAME, ';' ) AS "SQL" FROM information_schema.TABLES WHERE TABLE_SCHEMA = @database; |
See how easy that was? Isn’t it great when articles just get straight to the point? :)
제목 | 날짜 | ||
---|---|---|---|
107 | [기본] 구글 애드센스 컨설팅 - 하데스님의 블로그 구글 애드센스 최적화 가이드 편 | 5805 | 2007/11/13 |
106 | [기본] 블로거뉴스단에 가입하라. | 4 | 2007/11/13 |
105 | [브라우저] 파이어폭스 추천 확장기능 [2] [1] | 18573 | 2007/11/12 |
104 | [기본] MP3 무제한 다운로드 송사리 | 6407 | 2007/11/12 |
103 | [기본] 입력폼과 이미지폼의 정렬은 어떻게 맞추나요? | 5542 | 2007/11/09 |
102 | [기본] 쥬크온 1분 제한 제거 패치 | 4 | 2007/11/09 |
101 | [기본] 윈도를 빠르게 끄자. | 5149 | 2007/11/08 |
100 | [기본] 내 티스토리에 인기글 목록을 달아보자 | 5211 | 2007/11/08 |
99 | [기본] 각 블로그 포스팅에 대한 조회수를 설정해보자. | 5159 | 2007/11/08 |
98 | [기본] 오픈아이디, 내 도메인으로도 활용 가능할까? | 5131 | 2007/11/07 |
97 | [기본] Quick Search? | 4724 | 2007/11/06 |
96 | [기본] 구글 애드센스 주의할 점 [3] | 5806 | 2007/11/05 |