1.登陸
mysql -uroot -p
然后輸入密碼

2.查看已有的所有資料庫
show databases;

3.使用某個資料庫
use databasesname;

4.查看當前資料庫下現有的所有表
show tables;
5.在當前的資料庫下創建一個新表
create table if not exists tablename(
id int auto_increment,
a varchar(50) not null,
b varchar(5),
c varchar(10) not null,
d int not null,
e DATE,
primary key(id)
);
6.查看建立的表結構
desc tablename;
7.向表插入資料
insert into tablename values ('','','','','','');
8.查看插入資料后表的內容
select * from tablename;

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/72788.html
標籤:其他
