安装
sudo apt-get install mysql-server
初始化
sudo mysql_secure_installation
进入数据库
sudo mysql -uroot -p
command list:
列出现有数据库
show databases;
.........................................................
创建数据库
create database yoyo;
.........................................................
弃用数据库
drop database yoyo;
.........................................................
制定操作数据库
use yoyo;
.........................................................
创建表单
create table if not exists `namelist`(
`id` int unsigned auto_increment,
`name` varchar(10) not null,
`gender` varchar(10) not null,
primary key(`id`)
)engine=InnoDB default charset=utf8;
.........................................................
展示表单信息
desc namelist;
.........................................................
列出现有表单
show tables;
.........................................................
弃用表单
drop table namelist;
.........................................................
插入数据
insert into namelist(name,gender) values("Yoyo","male");
.........................................................