1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| #### 1.创建数据库 create database itpuxdb DEFAULT CHARSET utf8mb4;
#### 2.创建用户 CREATE USER 'itpux'@'%' IDENTIFIED BY 'itpux';
#### 3.查看所有用户 select host,user from mysql.user;
#### 4.为itpux用户分配权限 grant all privileges on itpuxdb.* to 'itpux'@'%' with grant option;
#### 5.创建表 use itpuxdb;
create table itpux01( id int auto_increment primary key, name varchar(15) ) engine = InnoDB;
#### 6.插入数据 insert into itpux01 values (1,'张三'); insert into itpux01 values (2,'李四'); insert into itpux01 values (3,'王五'); insert into itpux01 values (4,'赵六');
#### 7.查询数据 select * from itpuxdb.itpux01;
use itpuxdb select * from itpux01;
|