1. Adding a prefix to all tables in a MySQL database
SELECT Concat('ALTER TABLE ', TABLE_NAME, ' RENAME TO my_prefix_', TABLE_NAME, ';') FROM information_schema.tables WHERE table_schema = 'my_database'
출처 : https://steindom.com/articles/adding-prefix-all-tables-mysql-database
2.
SELECT
GROUP_CONCAT('RENAME TABLE `', TABLE_SCHEMA, '`.`', TABLE_NAME, '` TO `', TABLE_SCHEMA, '`.`prefix_', TABLE_NAME, '`;' SEPARATOR ' ')
FROM
`TABLES` WHERE `TABLE_SCHEMA` = "test";
참조
http://stackoverflow.com/questions/16339636/how-to-change-all-table-prefix-in-a-single-query
http://stackoverflow.com/questions/2466101/how-i-can-change-prefixes-in-all-tables-in-my-mysql-db
3. How to change a MySQL database’s table prefix
https://richjenks.com/change-mysql-database-table-prefix/
https://sir.kr/qa/145401
제목 | 날짜 | ||
---|---|---|---|
635 | [윈도우] [윈도우10] 가상데스크탑 활용하기(단축키) | 71 | 2020/02/01 |
634 | [리눅스서버] 리눅스 폴더 찾기 | 71 | 2020/04/13 |
633 | [엑셀] 엑셀 vba 년월일 | 73 | 2019/02/04 |
632 | [MySQL] MySQL 명령어 | 74 | 2017/03/15 |
631 | [GitHub] 이미 push된 file .gitignore 적용하기 | 74 | 2022/01/01 |
630 | [리눅스서버] Ubuntu php7.0-fpm 세팅 중 오류 | 76 | 2018/03/25 |
629 | [리눅스서버] [Ubuntu + Nginx + PHP7] 502 error log | 79 | 2017/03/07 |
628 | [Nginx] nginx-redirects-http-to-https-and-www-to-non-www | 79 | 2018/04/21 |
627 | [Apm] WPИ-XM | 80 | 2015/11/17 |
626 | [Nginx] Nginx Access Log 포맷 설정 | 80 | 2017/10/23 |
625 | [리눅스서버] 리눅스 계정 목록 보기 | 84 | 2017/06/26 |
624 | [Apm] xampp | 87 | 2015/11/18 |