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? :)
제목 | 날짜 | ||
---|---|---|---|
335 | [하드웨어] 잉크 토너 구매 | 9524 | 2010/03/08 |
334 | [생활] 원룸 알아볼 때 유의사항 | 10679 | 2010/03/09 |
333 | [브라우저] 인터넷 익스플로러 8에서 탭 빨리 열기 | 12467 | 2010/03/17 |
332 | [기본] 메일 사이트별 일반파일 첨부용량 가능사이즈 | 9663 | 2010/05/02 |
331 | [기본] USB 보안 프로그램 | 10928 | 2010/05/02 |
330 | [기본] USB 보안 관련 | 8264 | 2010/05/14 |
329 | [기본] 작업관리자 | 10382 | 2010/05/20 |
328 | [윈도우] USB_MultiBoot [1] | 12969 | 2010/05/23 |
327 | [기본] RISS 원노트로 인쇄하기 | 11961 | 2010/05/26 |
326 | [기본] Aspire 5572ANWXCi 설치 드라이버 | 10756 | 2010/06/03 |
325 | [윈도우] 도스에서 드라이버 레터 고정하기 [1] | 11507 | 2010/07/12 |
324 | [기본] HDMI 케이블 고르기 [1] | 10282 | 2010/07/14 |