ASP.NET Core分布式项目实战

默认教学计划
1052人加入学习
(33人评价)
价格 ¥398.00
教学计划

操作步骤:

  1. docker -d -p 3306:3306 name mysql01 mysql/mysql server  --character-set-server=utf8 --collation-server=utf8_general_ci:设置字符集
  2. docker -d -p 3306:3306 -e MYSQL_USER="LIUGUOJIANG" -e MYSQL_PASSWORD="PWD123456" --name mysql01 mysql/mysql server  --character-set-server=utf8 --collation-server=utf8_general_ci:设置用户名密码
  3. docker rm mysql01:上一节课已经创建了一个mysql01的镜像
  4. 重新执行第2步命令
  5. docker ps查看运行镜像
  6. docker logs mysql01
  7. docker exec -it mysql01 bash
  8. mysql -uliuguojiang -p;
  9. use mysql;
  10. exit;
  11. docker logs mysql01:查看寻找root密码
  12. docker -d -p 3306:3306 -e MYSQL_USER="LIUGUOJIANG"   -e MYSQL_PASSWORD="PWD123456" -e MYSQL_ROOT_PASSWORD="pwd123456" --name mysql01 mysql/mysql server  --character-set-server=utf8 --collation-server=utf8_general_ci

 

[展开全文]
docker run -d -p 3306:3306 
-e MYSQL_USER="lyle" 
-e MYSQL_PASSWORD="pwd123456" 
-e MYSQL_ROOT_PASSWORD="pwd123456" 
--name mysql01 mysql/mysql-server 
--character-set-server=utf8 
--collation-server=utf8_general_ci

docker exec -it mysql01 bash
mysql -uroot -p

select host,user,plugin,authentication_string from mysql.user;

CREATE USER 'lyle'@'localhost' IDENTIFIED BY 'pwd123456';
GRANT ALL PRIVILEGES ON *.* TO 'lyle'@'localhost' WITH GRANT OPTION;

CREATE USER 'root'@'%' IDENTIFIED BY 'pwd123456';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'pwd123456';
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pwd123456';

ALTER USER 'lyle'@'%' IDENTIFIED WITH mysql_native_password BY 'pwd123456';
ALTER USER 'lyle'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pwd123456';

 

[展开全文]

docker run -d -p 3306:3306

-e MYSQL_USER="sa"

-e MYSQL_PASSWORD="sa123456" 

-e MYSQL_ROOT_PASSWORD="root123456"

--name mysql01 mysql/mysql-server

--character-set-server=utf8

--collation-server=utf8_general_ci

 

 

 

docker exec -it mysql01 bash

[展开全文]

docker run -d -p 3306:3306 -e MYSQL_USER="xxx" -e MYSQL_PASSWORD="xx" -e

MY_ROOT_PASSWORD="rootpwd"

--name mysql mysql/mysql-server

--character-set-server=utf8

--collation-server=utf8_general_ci

 

[展开全文]

使用镜像创建容器

docker run -d -p 3306:3306 -e"MYSQL_USER=jerry" -e"MYSQL_PASSWORD=pwd123456" -e"MYSQL_ROOT_PASSWORD=password123"  --name mysql01 mysql/mysql-server --character-set-server=utf8 --collation-server=utf8_general_ci

命令解析:
--name:容器名

--p:映射宿主主机端口

-v:挂载宿主目录到容器目录

-e:设置环境变量,此处指定root密码

-d:后台运行容器

[展开全文]

授课教师

程序员

课程特色

下载资料(2)
视频(144)
讨论(1)
图文(2)