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
제목 | 날짜 | ||
---|---|---|---|
599 | [리눅스서버] ./configure : /bin/sh^M : bad interpreter [duplicate] | 145 | 2018/07/29 |
598 | [기타] G Suite - | 0 | 2018/07/26 |
597 | [MySQL] MySQL 사용자 테이블 생성 및 연결하기 | 93 | 2018/06/24 |
596 | [Nginx] [Nginx] Rewriterule 서브 도메인 입력시 하위 디렉토리로 이동하기 | 501 | 2018/05/15 |
595 | [Nginx] https가 아닐 경우 https로 리다이렉트하는 방법 | 170 | 2018/04/25 |
594 | [Nginx] nginx-redirects-http-to-https-and-www-to-non-www | 79 | 2018/04/21 |
593 | nginx https redirect www to non-www | 231 | 2018/04/04 |
592 | [리눅스서버] mysql strict mode 끄기 | 888 | 2018/03/29 |
591 | [리눅스서버] Ubuntu php7.0-fpm 세팅 중 오류 | 76 | 2018/03/25 |
590 | [리눅스서버] Ubuntu 16.04 | root 계정으로 로그인하기, root 계정으로 ssh 접속하기 | 91 | 2018/03/21 |
589 | [MySQL] Mysql Join 해부(Left, Right, Outer, Inner Join) | 154 | 2018/01/03 |
588 | HTTrack Website Copier 한글 언어팩 | 603 | 2018/01/03 |