Rename Tables in MySQL

Buy 1 Month, Get 2 Months Free. Coupon: 2MOFREE

If you want to hand code renaming tables, here’s the sample.

Single Table

RENAME TABLE wp_users TO kwg_users;

multiple tables

RENAME TABLE wp_users TO kwtg_users,
wp_usermeta TO kwtg_usermeta,
wp_site TO kwtg_wpsite,
wp_signups TO kwtg_signups;

This is handy when renaming a whole lot of tables as in the case of WordPress mu where each blog has its own set of tables. If you decide to rename them for security reasons (like you forgot to change the default table prefix during installation), it will be a pain to change them one by one through phpMyAdmin.

Incoming search terms:

  • mysql rename table recursively
  • rename multiple tables mysql
  • rename table in mysql
  • rinomina wp-posts in my sql

Related posts:

  1. Modified WP Table Prefix in bbPress

Speak Your Mind

*