title: How to change all table prefix in a single query
body: <p>I am pretty amateur in mysql..can you please tell me how can I change table prefixes of my whole database in a single query... I can do it manually, but its quite time consuming to change all the tables prefixes. Please help me out. Like isc_administrator_log to cus_administrator_log   means   isc_  to  cus_</p>
  
  <p>I found these two solutions but do not understand either of them.</p>
  
  <pre><code>SELECT 
  GROUP_CONCAT('RENAME TABLE `', TABLE_SCHEMA, '`.`', TABLE_NAME, '` TO `', 
  TABLE_SCHEMA, '`.`prefix_', TABLE_NAME, '`;' SEPARATOR ' ')
  FROM `TABLES` WHERE `TABLE_SCHEMA` = "test";
  </code></pre>
  
  <p>and</p>
  
  <pre><code>SELECT 
  CONCAT('RENAME TABLE ', GROUP_CONCAT('`', TABLE_SCHEMA, '`.`', TABLE_NAME,
  '` TO `', TABLE_SCHEMA, '`.`prefix_', TABLE_NAME, '`')) AS q
  FROM 
  `information_schema`.`Tables` WHERE TABLE_SCHEMA='test';
  </code></pre>