ASP.NET Core分布式项目实战

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

操作步骤:

  1. 下载镜像:docker pull mysql/mysql-server
  2. docker run -d -p 3306:3306 --name mysql01 mysql/mysql-server
  3. 查看:docker ps
  4. docker logs mysql01--拷贝密码
  5. docker exec -it mysql01 bash
  6. mysql -u root  -p {password}
  7. use mysql
  8. SET PASSWORD FOR 'root'@'localhost'=PASSWORD('MyNewPassword');
  9. select user,host from user;
  10. CREATE USER 'liuguojiang'@'localhost' IDENTIFIED BY 'pwd23456';
  11. GRANT ALL PRIVILEGES ON *.* TO 'liuguojiang'@'localhost' WITH GRANT OPTION;
  12. CREATE USER 'liuguojiang'@'%' IDENTIFIED BY 'pwd123456';
  13. GRANT ALL ON *.* TO 'liuguojiang'@'%' WITH GRANT OPTION;
  14. SELECT USER,HOST FROM USER
  15. show vriables '%char%';
  16. exit;
  17. cd /etc
  18. cd my.cnf
  19. yun install vim
  20. cd /etc
  21. vim my.cnf
  22. 修改MYSQL默认字符集
    1. [mysql]
    2. character-set-server=utf8
    3. [client]
    4. default-character-set=utf8
    5. [mysql]
    6. default-character-set=utf8
  23. esc,输入wq
  24. mysql --help

 

[展开全文]
mysql5.7版本语法:SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password123');
mysql5.7之后版本语法: ALTER user 'root'@'localhost' IDENTIFIED BY 'password1'

 

mysql> CREATE USER 'test'@'localhost' IDENTIFIED BY 'pwd123456';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'test'@'localhost' WITH GRANT OPTION;
mysql> CREATE USER 'test'@'%' IDENTIFIED BY 'pwd123456';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'test'@'%' WITH GRANT OPTION;

 

Navicat 无法连接

查看用户信息

mysql> select host,user,plugin,authentication_string from mysql.user;
mysql> ALTER USER 'test'@'%' IDENTIFIED WITH mysql_native_password BY 'pwd123456';
mysql> ALTER USER 'test'@'localhost' IDENTIFIED WITH mysql_native_password BY 'pwd123456';
[展开全文]
ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';

 视频里面的修改 root 密码的sql会提示有语法错误,使用官方文档里面的sql语句是没有问题的

[展开全文]

Navicat mysql客户端

docker exec -it mysql01 bash 进入容器命令

mysql 命令

mysql -u localhost root -p 登录mysql

user mysql

select user ,host from user

[展开全文]

授课教师

程序员

课程特色

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