镇场文:
学儒家经世致用,行佛家普度众生,修道家全生保真,悟易理象数通变。以科技光耀善法,成就一良心博客。
______________________________________________________________________________________________________
Operating System:UbuntuKylin 16.04 LTS 64bit
mysql: Ver 14.14 Distrib 5.7.17, for Linux (x86_64) using EditLine wrapper
step1:
查看表的结构
mysql> describe Using_Engineer; +------------------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------+----------+------+-----+---------+-------+ | ID_Engineer | char(5) | NO | PRI | NULL | | | Using_Engineer | bit(1) | NO | | NULL | | | Time_Build_STM | char(16) | NO | | NULL | | | Time_Abandon_STM | char(16) | YES | | NULL | | +------------------+----------+------+-----+---------+-------+ 4 rows in set (0.00 sec)
step2:
改一个列的名字
mysql> alter table Using_Engineer change Time_Build_STM Time_Build_Engineer char(16) not null; Query OK, 0 rows affected (0.08 sec) Records: 0 Duplicates: 0 Warnings: 0
注: Using_Engineer:表名 Time_Build_STM:旧列名 Time_Build_Engineer char(16) not null:新列名及其属性
step3:
mysql> describe Using_Engineer; +---------------------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------------+----------+------+-----+---------+-------+ | ID_Engineer | char(5) | NO | PRI | NULL | | | Using_Engineer | bit(1) | NO | | NULL | | | Time_Build_Engineer | char(16) | NO | | NULL | | | Time_Abandon_STM | char(16) | YES | | NULL | | +---------------------+----------+------+-----+---------+-------+ 4 rows in set (0.00 sec)
______________________________________________________________________________________________________
若是您觉得此博文有可以改进的地方或者内容过时了,请评论,我会仔细思考的。
注:此博文仅用于科研学习,如果侵犯到您的权益,请及时告知,我会做出相应的处理。
时间: 2024-10-08 02:21:08