yum -y localinstall http://mirrors.ustc.edu.cn/mysql-repo/mysql57-community-release-el7.rpm
yum install -y mysql-community-server # 未执行这个命令,启动MySQL表示会自动生成一个临时root密码使用
if [ ! "$(cat /usr/bin/mysqld_pre_systemd | grep -v ^\# | grep initialize-insecure )" ]; then
sed -i "s@--initialize @--initialize-insecure @g" /usr/bin/mysqld_pre_systemd
fi # 查看生成的临时root密码
# grep 'password' /var/log/mysqld.log |head -n 1
2021-12-10T02:42:42.582937Z 1 [Note] A temporary password is generated for root@localhost: e?qh1g<!MaW1 # 使用临时密码登录后需要修改这个密码才能进行操作
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. # 修改root密码 (没有关闭密码安全性校验规则)
alter user 'root'@'localhost' identified by 'D6WrGAiOl7*6SU0b!'; systemctl enable mysqld
systemctl start mysqld mysql -uroot Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.32 MySQL Community Server (GPL) Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. # 设置root密码,关闭密码复杂度策略
mysql> set global validate_password_policy=0;
mysql> set global validate_password_length=1;
mysql> use mysql;
mysql> update user set authentication_string=password('123456') where user='root';
mysql> flush privileges; mysql> create database jumpserver default charset 'utf8';
Query OK, 1 row affected (0.00 sec) mysql> set global validate_password_policy=LOW;
Query OK, 0 rows affected (0.00 sec) mysql> create user 'jumpserver'@'%' identified by 'weakPassword';
Query OK, 0 rows affected (0.00 sec) mysql> grant all on jumpserver.* to 'jumpserver'@'%';
Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec) mysql> exit
Bye

最新文章

  1. 关getClass().getClassLoader()
  2. python中的时间转换
  3. 中缀表达式转后缀表达式(用于求字符串表达式值)(js栈和队列的实现是通过数组的push和unshift方法插值,pop方法取值)
  4. 【python】入门学习(七)
  5. express html模板项目搭建
  6. 【转】IT 圈里有哪些经常被读错的词?
  7. HTML5本地存储之localStorage、sessionStorage
  8. find命令小结
  9. LeetCode中有技巧的题需要面试前记得的
  10. jq选择器 第一部分
  11. USACO5.4-Character Recognition
  12. javascript继承的写法
  13. webgl 网站demo
  14. Video Target Tracking Based on Online Learning—深度学习在目标跟踪中的应用
  15. c语言之单链表的创建及排序
  16. Mybatis Generator的model生成中文注释,支持oracle和mysql(通过实现CommentGenerator接口的方法来实现)
  17. 阿里云学生服务器搭建网站-Ubuntu16.04安装php开发环境
  18. hdu 2546 饭卡【01背包】
  19. block详解
  20. 在CentOS 6.X中安装中文字体

热门文章

  1. 常用Linux音译
  2. &#39;cross-env&#39; 不是内部或外部命令
  3. ooday06 内部类
  4. 算法竞赛进阶指南0x36组合计数
  5. Linux安装mysql8.0.29详细教程
  6. 彻底弄清楚session,cookie,sessionStorage,localStorage的区别及应用场景(面试向)
  7. linux-0.11分析:boot文件 setup.s 第二篇随笔
  8. 故障案例 | 主从复制环境中tokudb引擎报错排查过程
  9. 最新豆瓣top250爬虫案例代码分析[注释齐全]
  10. 人人都能看懂的卡西欧fx991cnx玩机指南,手把手教你如何利用计算器的漏洞爆机