MySQL在dos窗口的进入方式及操作

MySQL在dos窗口的进入方式
开始-->所有程序-->MySQL-->MySQL server5.1-->MySQL command the client-->输入密码进行登录

dos窗口下操作数据库
退出:quit、exit、\q、Ctrl+c
库的操作:
显示有哪些库:show databases;
创建库:create database 库名; 库名不能以数字开头
删除库:drop database 库名;
表的操作:
进入库/使用库:use 库名
显示库中有哪些表:show tables;
创建表:create table 表名(字段名 字段类型,字段名 字段类型....)
删除表:drop table 表名;
显示表的结构:desc 表名;
修改表:alter
增加字段:alter table 表名 add 字段名 字段类型;
删除字段:alter table 表名 drop column 字段名;
修改字段类型:alter table 表名 modify 字段名 新类型;

posted @ 2017-04-30 15:01  威振  阅读(507)  评论(0编辑  收藏  举报