1、在docker中分别以后台方式和交互方式启动centos,对比启动后的容器状态,实现退出容器也能保持其运行状态。
[root@CentOS ~]#docker run -d centos //后台方式
76e8d53e483a1d53ad18c78ce4075fd9d72ecf01616d243f52218e1f40d03859
[root@CentOS ~]#docker run -it centos //交互方式
# 按住ctrl+Q+P,实现退出容器也是运行状态
[root@a68de992f07f /]# [root@CentOS ~]#
[root@CentOS ~]#docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a68de992f07f centos "/bin/bash" 45 seconds ago Up 42 seconds kind_bouman
76e8d53e483a centos "/bin/bash" 2 minutes ago Exited (0) 2 minutes ago vibrant_curie
2、在docker并部署DVWA,要求:DVWA web 端口映射到8082,提供访问截图。
[root@CentOS ~]#docker run -d --name dvwa -p 8082:80 sagikazarmark/dvwa
3、Mysql练习
(1)创建一个名为"magedu_C10"的数据库;
mysql> create database magedu_C10; //创建一个名为"magedu_C10"的数据库
Query OK, 1 row affected (0.00 sec)
#查看是否创建成功
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| magedu_C10 |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.01 sec)
(2)在magedu_C10数据库中创建一张名为"table_Sec"的表,要求有序号、姓名、年龄、性别参数;
# 进入到magedu_C10数据库中
mysql> use magedu_C10;
Database changed
# 创建表table_Sec
mysql> create table table_Sec(
-> id int,
-> name varchar(255),
-> age int,
-> sex varchar(255)
-> );
Query OK, 0 carows affected (0.03 sec)
# 查看表是否创建成功
mysql> show tables;
+----------------------+
| Tables_in_magedu_C10 |
+----------------------+
| table_Sec |
+----------------------+
1 row in set (0.00 sec)
# 查看表中的参数是否创建成功
mysql> desc table_Sec;
+-------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+-------+
| id | int | YES | | NULL | |
| name | varchar(255) | YES | | NULL | |
| age | int | YES | | NULL | |
| sex | varchar(255) | YES | | NULL | |
+-------+--------------+------+-----+---------+-------+
4 rows in set (0.01 sec)
(3)在table_Sec表中插入数据,序号是个人学号数字部分,姓名是拼音缩写,年龄、性别无要求;
#插入数据
mysql> insert into table_Sec values(25,'xmz',18,'girl');
Query OK, 1 row affected (0.01 sec)
#查询是否成功插入
mysql> select * from table_Sec;
+------+------+------+------+
| id | name | age | sex |
+------+------+------+------+
| 25 | xmz | 18 | girl |
+------+------+------+------+
1 row in set (0.00 sec)
(4)使用Navicat连接你所创建的数据库,查看个人信息并提供截图。
4、以下哪个口令不是弱口令?
A. p@ssw0rd
B. m@a#g$e%d&u
C. 1QAZ2wsx
D. MaGEdu@0513
答:ABCD
标签:03,magedu,Sec,mysql,table,docker,C10 From: https://www.cnblogs.com/bokexiLu/p/18387254