mySql 的基本操作

mysql -uroot -p
root

show databases;

use ltcl_net;
show tables;

desc tablename; 查看表结构


create table test (    id int not null,    last_name char(30) not null,    first_name char(30) not null,    primary key (id),    index name (last_name,first_name));name索引是一个对last_name和first_name的索引。索引可以用于为last_name,或者为last_name和first_name在已知范围内指定值的查询。

create table test
(
   localt               char(20) not null,
   cd                   char(5) not null,
   snosat               char(2) not null,
   rnorec               char(3) not null,
   id                   INT(20) not null AUTO_INCREMENT,
   primary key (id)
);

 DROP TABLE test;//删除表

alter table e_down add soft_version1 varchar(50);//增加字段

查询数据库中的存储过程
 
方法一:
       select `name` from mysql.proc where db = 'your_db_name' and `type` = 'PROCEDURE'
 
方法二:
         show procedure status;

mysql -uroot -proot -Dxqpd<sql路径 -->导入数据库内容,xqpd为数据库名称,需新建

原文地址:https://www.cnblogs.com/fm168/p/3271931.html