打开终端后输入:/usr/local/MySQL/bin/mysql -u root –p
然后输入密码:*****
创建数据库:create database work;
使用当前数据库:use work;
创建一个表格:create table work(name char(20),sec char(20),age int);
显示表格:show tables;
查看表格详情:desc worl;
完成之后添加每个列的数据:
insert into work(name,sec,age) values('张三','男',18);
insert into work(name,sec,age) values('李四','男',18);
insert into work(name,sec,age) values('王五','男',20);
insert into work(name,sec,age) values('赵六','男',25);
选取查看所有内容:
select * from work;