sql 命令操作用法

---恢复内容开始---

远程登录数据库:

mysql -u root -p

要求输入密码

==============

查看数据库:

show databases;
=============

选择数据库:

use test;
======

相看数据库中数据表的情况:

show tables;
==========

查看数据表的结构情况:

describe name;

==========

增加字段

1.增加字段
     alter table 数据表名     add 字段名  字段类型

as: alter table tablename add time int(11)

=====================

2.删除字段

ALTER TABLE table_NAME DROP COLUMN column_NAME

as: alter table tablename drop column time

======================

---恢复内容结束---

原文地址:https://www.cnblogs.com/lin3615/p/3657863.html