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? :)
제목 | 날짜 | ||
---|---|---|---|
83 | [기본] 적당한 마우스 스크롤의 양 | 6325 | 2007/10/31 |
82 | [기본] 네이버 플래시 동영상 다운받기 | 7295 | 2007/10/31 |
81 | [기본] 각종 플래시 동영상을 쉽게 다운로드받는 방법 | 10006 | 2007/10/31 |
80 | [브라우저] 파이어폭스 즐겨찾기 관리 어떻게 할까? | 2 | 2007/10/30 |
79 | [브라우저] [Firefox 파이어폭스]사람들은 어떤 확장기능을 사용하고 있을까? | 8859 | 2007/10/29 |
78 | [브라우저] 가릉빙가님께서 사용하시는 파이어폭스 확장기능입니다 | 8554 | 2007/10/29 |
77 | [기본] 프로디지 7.1 LT 녹음하기 | 5465 | 2007/10/29 |
76 | [기본] [프로디지 7.1 LT] 인터넷 녹음시 잡음이 심합니다. | 4701 | 2007/10/29 |
75 | [기본] [프로디지 7.1 LT][참고] 다이렉트와이어 설정방법 및 NSP 활용방법 (초보용) | 6256 | 2007/10/29 |
74 | [기본] 작업관리자에서 필요없는 실행프로세서를 죽이자. | 6230 | 2007/10/28 |
73 | [기본] Adobe Fonts 폴더 활용하기 | 5486 | 2007/10/28 |
72 | [기본] mDNSResponder.exe 의 정체에 대해서 [1] | 8021 | 2007/10/28 |