[MySQL] Mysql 프리픽스 수정하기
2017.03.15 17:46
87
0
https://eond.com/379908

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

라이믹스는 이온디와 함께

웹팁
-
+
닫기

마이페이지

로그인을 해주세요

네이버로 로그인