mysql - what is the difference between 'alter table rename' and 'rename table'? -
i using mysql. here's example, want rename table b, what's difference between following statement:
alter table rename b;
and one:
rename table b;
can give detail compare between them? vary based on different engine?
as documented under alter table
syntax:
for
alter table tbl_name rename new_tbl_name
without other options, mysql renames files correspond tabletbl_name
without making copy. (you can userename table
statement rename tables. see section 13.1.32, “rename table
syntax”.) privileges granted renamed table not migrated new name. must changed manually.
as documented under rename table
syntax:
you cannot use
rename
renametemporary
table. however, can usealter table
instead:mysql> alter table orig_name rename new_name;
there no other differences.
Comments
Post a Comment