[摘要]+--------+--------------------------------------------------------------+1 row in set (0.00 sec)sho...
+--------+--------------------------------------------------------------+
1 row in set (0.00 sec)
show create table t_dept \G
mysql> show create table t_dept \G
*************************** 1. row ***************************
Table: t_dept
Create Table: CREATE TABLE `t_dept` (
`deptno` int(11) DEFAULT NULL,
`dname` varchar(20) DEFAULT NULL,
`loc` varchar(40) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
删除表
drop table 表名
drop table if exists 表名
mysql> drop table if exists t_dept;
Query OK, 0 rows affected (0.12 sec)
mysql> show tables;
Empty set (0.00 sec)
修改表名
ALTER TABLE old_table_name RENAME [TO] new_table_name
old_table_name 原表名
new_table_name 新表名
将t_dept修改为tab_dept
mysql> alter table t_dept rename tab_dept;
Query OK, 0 rows affected (0.09 sec)
mysql> show tables;
+-------------------+
关键词:mysql学习之表的基本设置的代码分享