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? :)
제목 | 날짜 | ||
---|---|---|---|
443 | 원격컴퓨터소리 | 5251 | 2008/08/21 |
442 | Microsoftp RDP Audio Driver [1] | 5781 | 2008/08/21 |
441 | xp 공유 안될 때 [1] | 5758 | 2008/08/27 |
440 | 사운드카드 확인 [2] | 8564 | 2008/08/28 |
439 | C-Media CMI8738/C3DX PCI Audio Device v5.12.1.646 Driver [1] | 9478 | 2008/08/28 |
438 | [윈도우] 윈도우 복구 콘솔세상풍경 | 10401 | 2008/08/30 |
437 | [윈도우] 윈도우 복구 콘솔 명령어 리스트 | 13915 | 2008/08/30 |
436 | 메인보드 전원 케이블 연결 | 5979 | 2008/08/30 |
435 | [윈도우] 복구콘솔 사용법 | 10008 | 2008/08/30 |
434 | [윈도우] 복구 콘솔을 하드에 설치하는 방법 | 11079 | 2008/08/30 |
433 | 부팅 시 ntoskrnl.exe 에러 메시지가 발생을 했을 때 해결 방안 | 8034 | 2008/08/30 |
432 | REMOTE VIEWER | 3898 | 2008/08/30 |