Mysql 数据库创建基本步骤
来源:互联网 发布:博拉网络股份有限公司 编辑:程序博客网 时间:2024/05/22 21:35
1.创建数据库
create database school;
2.使用数据库
Use school;
3.创建用户
create user jame@localhost identified by 'jame';
4.授权用户(注意这里是用了*哦,自己将school也替换成*号)
grant select,update,insert,create on school.* to jame@localhost identified by 'j ame';
5.取消授权(现在明白为啥直接敲privilege 没用了吧?)
revoke select,update,insert,create on school.* from jame@localhost;
6.创建表
create table students(s_name varchar(10) not null,age int(3),sex char(1),heig ht int,s_no varchar(20) not null,primary key(s_no));
7.修改表名
alter table students rename to student;
8.修改列
alter table students change s_name name varchar(20) not null;
9.增加列
alter table student add class varchar(20);
10.删除列
alter table student drop column class;
11.删除表
drop table student;
12.删除用户
drop user jame;
13.删除数据库
drop database school;
查看数据库的表结构方法 desc students; 或者 describe students; 另:mysql用户进入控制台后无法切换用户,只能先退出终端,再重新连接。
- Mysql 数据库创建基本步骤
- (0015)iOS 开发之Mac上安装MySQL服务与创建数据库的基本步骤
- R连接mysql数据库基本步骤
- MySQL数据库JDBC连接基本步骤
- MySQL的基本配置与创建数据库
- JDBC连接mysql数据库最基本的步骤简介
- MYSQL的创建新用户数据库的步骤实例
- 创建Oracle数据库步骤
- 手动创建数据库步骤
- 手动创建数据库步骤
- Oracle 创建数据库步骤
- oracle创建数据库步骤
- 创建HttpServlet的基本步骤
- 创建HttpServlet的基本步骤
- 创建ListView的基本步骤
- 创建ListView的基本步骤
- WEBPACK 创建基本项目步骤
- MYSQL数据库安装步骤
- curl远程请求数据
- Vue2.0实现购物车示例
- js模拟事件
- springcloud(十):服务网关zuul
- 银行核心与前置系统笔记
- Mysql 数据库创建基本步骤
- 观察者模式
- 你应该了解的Android Interface
- hdu 3549 Flow Problem
- 关于初次搭建环境切换老版本出现错误gcc: error: unrecognized command line option ‘-mthumb’的解决方案
- 蓝桥杯 BEGIN-3 入门训练 圆的面积
- Intellij Idea 中hibernate 反向生成实体
- Ethernet PHY芯片AR8035驱动
- codeforces 27 E. Number With The Given Amount Of Divisors(反素数)