mysql关于删除的命令实例源码。
(1)删除mysql数据库命令
drop database databasename; //删除数据库前,没有提示
mysqladmin drop databasename; //删除数据库前,有提示
(2)删除某张表命令
drop table tablename;
(3)清空某张表命令
delete from tablename;
(4)删除符合条件的某些记录语句
delete from tablename where id=xxx;
(5)删除授权语句
revoke all privileges on *.* from root@”%”;
delete from user where user=”root” and host=”%”;
flush privileges; //刷新数据库
(6)删除外键语句:
ALTER TABLE yourtablename DROP FOREIGN KEY fk_symbol;
(7)删除列命令
alter table table_name drop column_name; //删除表列