以上篇博客創建的users表為例子;
還是先進入onlinedb
use onlinedb;
修改
修改表名
ALTER TABLE users RENAME user;
修改字段位置
ALTER TABLE user MODIFY uPswd VARBINARY(20) AFTER uSex;
驗證:desc user;
在user表中增加字段,用於存放用戶注冊時間
ALTER TABLE user ADD uRegTime TIMESTAMP;
刪除字段
ALTER TABLE user DROP uRegTime;
驗證:desc user;
修改表的存貯引擎
ALTER TABLE user ENGINE=MyISAM;