How to rename a view in MySQL?
Rename didn't work for me, what I did was:
Stop MySQL, change to my database directory, and rename from my_old_view.frm
to my_new_view.frm
.
I was using linux, so the commands were:
/etc/init.d/mysqld stop
cd /var/lib/mysq/DatabaseName
mv my_old_view.frm my_new_view.frm
/etc/init.d/mysqld start
DROP VIEW IF EXISTS vw_extr;
CREATE VIEW vw_my ...
You'll have to fill my ...
with your view's DDL.
You can use RENAME TABLE
for that:
RENAME TABLE vw_extr to vw_my