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? :)
제목 | 날짜 | ||
---|---|---|---|
251 | [웹로그] 파이어폭스 설치된 플러그인을 다른 컴퓨터에서도 사용하는 방법 | 5848 | 2007/10/27 |
250 | [웹로그] 컴퓨터로 라디오 듣기 | 6409 | 2007/10/24 |
249 | [웹로그] 탐색기 파일 목록 텍스트로 저장하기 [1] | 8016 | 2007/10/23 |
248 | [웹로그] 카스퍼스키 무료로 사용하기 | 6769 | 2007/10/23 |
247 | [웹로그] 픽픽(PicPick) v1.7.2 Release | 5032 | 2007/10/22 |
246 | [데스크탑/액세서리] 무료 컴퓨터 화면 녹화 프로그램, 컴퓨터 화면 동영상으로 캡쳐 CamStudio 2.7 [7] [2] | 9337 | 2007/10/22 |
245 | [웹로그] 시작프로그램 관리 & 모니터링 | 5292 | 2007/10/21 |
244 | [웹로그] 구글에서 mp3 다운받기 | 7672 | 2007/10/20 |
243 | [웹로그] 어느 기하학자의 한글 창제 | 4972 | 2007/10/19 |
242 | [웹로그] 구글애드센스 광고형식 (작성중) | 0 | 2007/10/19 |
241 | [웹로그] 파이어폭스 사용자 입맛에 고치기 | 0 | 2007/10/13 |
240 | [웹로그] 요즘 사용하고 있는 위젯형식의 개인화페이지 | 6998 | 2007/10/11 |