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 | [Nginx] Nginx 모니터링 툴 | 400 | 2017/10/23 |
106 | [MySQL] MySQL/MariaDB 비밀번호 변경 | 611 | 2017/10/26 |
105 | [Nginx] : /bin/bash^M: bad interpreter: No such file or directory | 63 | 2017/10/28 |
104 | [리눅스서버] 계정등록(adduser) 기능 및 옵션, 계정 변경(usermod) | 325 | 2017/10/28 |
103 | [Nginx] SSL Lets Encrypt certbot | 490 | 2017/11/01 |
102 | [Nginx] certbot 수동 발급 | 0 | 2017/11/02 |
101 | [Nginx] 리노드 서버 다운그레이드 | 0 | 2017/11/08 |
100 | [웹 제작] 모바일에서 쇼핑몰이나 홈페이지 들어가면 자동적으로 바탕화면에 즐찾 생성 되는 방법 | 0 | 2017/12/02 |
99 | [사이트관리] SEO 작업 | 328 | 2017/12/04 |
98 | [GitHub] develop 을 git pull 하기 | 0 | 2017/12/05 |
97 | [텔넷] 터미널에서 ssh 접속하기 | 275 | 2017/12/12 |
96 | HTTrack Website Copier 한글 언어팩 | 603 | 2018/01/03 |