[root@VM-24-13-centos ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE mysql 5.7 c20987f18b13 2 months ago 448MB hello-world latest feb5d9fea6a5 5 months ago 13.3kB
注意:如果运行时添加了marvin用户,用root登录后执行用户授权ALTER USER 'marvin'@'%' IDENTIFIED WITH mysql_native_password BY 'password123';,才能用远程客户端访问数据库。
使用客户端(HeidiSQL)连接,用户名为root,密码为root1234567
连接成功后,创建数据库和表
在服务器也可采用如下命令进入容器内部
1 2 3 4 5 6 7 8 9 10
docker exec -it mysqltest mysql -uroot -proot1234567 mysql> select * from demo.student; +----+------+------+---------+ | id | name | sex | address | +----+------+------+---------+ | 1 | ?? | ? | 22333 | +----+------+------+---------+ 1 row in set (0.00 sec)
python实践
搜索python镜像:docker search python3
拉取python3.7的镜像
1
docker pull rackspacedot/python37
拉取成功后可以看到镜像
1 2 3 4 5 6
[root@VM-24-13-centos ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE rackspacedot/python37 latest 4513b6d75e1c 3 weeks ago 1.03GB mysql 5.7 c20987f18b13 2 months ago 448MB hello-world latest feb5d9fea6a5 5 months ago 13.3kB