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 table tbl_name without making copy. (you can use rename 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 rename temporary table. however, can use alter table instead:

mysql> alter table orig_name rename new_name;

there no other differences.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -