5.76中加了一些passwd的策略
MySQL's validate_password plugin is installed by default. This will require that passwords contain at least one upper case letter, one lower case letter, one digit, and one special character, and that the total password length is at least 8 characters.
修改passwd
获取临时password
[root@own ~]# grep 'temporary password' /var/log/mysqld.log
2017-09-19T10:41:04.391873Z 1 [Note] A temporary password is generated for root@localhost: gyqfjhKrB7,o
修改passwd policy
[root@own ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.19
Copyright (c) 2000, 2017, 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.
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Test@123';
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password_check_user_name | OFF |
| validate_password_dictionary_file | |
| validate_password_length | 8 |
| validate_password_mixed_case_count | 1 |
| validate_password_number_count | 1 |
| validate_password_policy | MEDIUM |
| validate_password_special_char_count | 1 |
+--------------------------------------+--------+
7 rows in set (0.03 sec)
mysql> SET GLOBAL validate_password_policy='LOW';
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------+-------+
| validate_password_check_user_name | OFF |
| validate_password_dictionary_file | |
| validate_password_length | 8 |
| validate_password_mixed_case_count | 1 |
| validate_password_number_count | 1 |
| validate_password_policy | LOW |
| validate_password_special_char_count | 1 |
+--------------------------------------+-------+
7 rows in set (0.00 sec)
mysql> set GLOBAL validate_password_length=6;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------+-------+
| validate_password_check_user_name | OFF |
| validate_password_dictionary_file | |
| validate_password_length | 6 |
| validate_password_mixed_case_count | 1 |
| validate_password_number_count | 1 |
| validate_password_policy | LOW |
| validate_password_special_char_count | 1 |
+--------------------------------------+-------+
7 rows in set (0.00 sec)
mysql> set GLOBAL validate_password_mixed_case_count=0;
Query OK, 0 rows affected (0.00 sec)
mysql> set GLOBAL validate_password_number_count=0;
Query OK, 0 rows affected (0.00 sec)
mysql> set GLOBAL validate_password_special_char_count=0;
Query OK, 0 rows affected (0.00 sec)
mysql> set GLOBAL validate_password_length=0;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+-------+
| Variable_name | Value |
+--------------------------------------+-------+
| validate_password_check_user_name | OFF |
| validate_password_dictionary_file | |
| validate_password_length | 0 |
| validate_password_mixed_case_count | 0 |
| validate_password_number_count | 0 |
| validate_password_policy | LOW |
| validate_password_special_char_count | 0 |
+--------------------------------------+-------+
7 rows in set (0.00 sec)
修改passwd为空
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '';
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> quit
Bye
验证
[root@own ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 5.7.19 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, 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.
mysql> quit
Bye
[root@own ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.7.19 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, 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.
mysql> quit
Bye
on mac
shell> cd /usr/local/mysql
shell> sudo ./bin/mysqld_safe
(ENTER YOUR PASSWORD, IF NECESSARY)
(PRESS CONTROL-Z)
shell> bg
(PRESS CONTROL-D OR ENTER "EXIT" TO EXIT THE SHELL)
You should be able to connect to the MySQL server, for example, by
running `/usr/local/mysql/bin/mysql -uroot'.
- mysql修改root密码和对连接授权
mysql修改root密码 首先 mysql -uroot -p 进入mysql界面后执行 set password for root@localhost = password('111111'); ...
- mysql修改root密码百分百解决你的问题
原文:mysql修改root密码百分百解决你的问题 1.MySQL版本8.0.4之后修改密码 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_n ...
- mysql修改root密码和设置权限
整理了以下四种在MySQL中修改root密码的方法,可能对大家有所帮助! 方法1: 用SET PASSWORD命令 mysql -u root mysql> SET PASSWORD FOR ' ...
- MySQL 修改 root 密码命令
安装好 MySQL 并成功启动 MySQL 服务后,可以通过以下方法修改root密码: ①用 mysqladmin.exe 操作.指令如下: cd C:\Program Files\MySQL Ser ...
- MySql修改root密码以及允许外网访问
1.修改root密码 用SET PASSWORD命令 mysql -u root mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('n ...
- MySQL修改root密码的各种方法整理(转)
整理了以下四种在MySQL中修改root密码的方法,可能对大家有所帮助! 方法1: 用SET PASSWORD命令 mysql -u root mysql> SET PASSWORD FOR ' ...
- 各版本mysql修改root密码
今天在安装mysql5.7.8的时候遇到一些问题,首当其冲便的是初始root密码的变更,特分享解决方法如下: 1.mysql5.7会生成一个初始化密码,而在之前的版本首次登陆不需要登录. shell& ...
- mysql修改root密码和设置权限 转摘:http://www.cnblogs.com/wangs/p/3346767.html
整理了以下四种在MySQL中修改root密码的方法,可能对大家有所帮助! 方法1: 用SET PASSWORD命令 mysql -u root mysql> SET PASSWORD FOR ' ...
- windows 8.0 mysql 修改root 密码
Mysql 忘记root密码和修改root密码的解决方法(小结) 一.以下是Windows操作系统的操作步骤: 1. 关闭正在运行的MySQL服务-->net stop mysql 2. 打开D ...
- Mysql修改root密码
一.启动命令行,输入: taskkill /f /im mysqld.exe //关闭mysql 二.转入mysql的bin目录下 三.输入:mysqld --skip-grant-tables // ...
随机推荐
- 深度学习笔记之目标检测算法系列(包括RCNN、Fast RCNN、Faster RCNN和SSD)
不多说,直接上干货! 本文一系列目标检测算法:RCNN, Fast RCNN, Faster RCNN代表当下目标检测的前沿水平,在github都给出了基于Caffe的源码. • RCNN RCN ...
- [IT学习]转载python 项目 计算器
这个是从网上搜到的Python小项目之计算器(原文地址:http://www.2cto.com/kf/201402/279637.html).但该段代码估计是Python 2 写的. 如果你使用的程序 ...
- 第一个WordCount类运行
import java.io.IOException; import java.util.*; import org.apache.hadoop.fs.Path; import org.apache. ...
- (17)会话之Cookie的使用详解
Cooke技术 1,特点 Cookie技术:会话数据保存在浏览器客户端. 2,Cookie技术核心 Cookie类:用于存储会话数据 1)构造Cookie对象 Cookie(java.lang.St ...
- (14)javaWeb中的HttpServletResponse类详解
如果希望了解请求和响应的详细内容,可以看我的“HTTP协议”系列文章 响应体的简单概述: a,响应报文结构: b,常见的状态码,返回服务器处理的结果: c,常见的响应头: HttpServletRes ...
- HDU2389 Rain on your Parade —— 二分图最大匹配 HK算法
题目链接:https://vjudge.net/problem/HDU-2389 Rain on your Parade Time Limit: 6000/3000 MS (Java/Others) ...
- Linux网络协议栈(二)——套接字缓存(socket buffer)
Linux网络核心数据结构是套接字缓存(socket buffer),简称skb.它代表一个要发送或处理的报文,并贯穿于整个协议栈.1. 套接字缓存skb由两部分组成:(1) 报文数据:它 ...
- 洛谷 P1311 选择客栈 —— 水题
题目:https://www.luogu.org/problemnew/show/P1311 看每个位置能否成为咖啡店,然后作为客栈和前面配对即可. 代码如下: #include<iostrea ...
- body和html
1 关于html和body的背景颜色的一些变现 当给body设置背景颜色时(html没有背景颜色),这时body被当做根节点被浏览器俘获,浏览器界面的背景颜色就为body的background颜色:当 ...
- 关于final修饰符
一:修饰成员变量 关于被final修饰的成员属性(常量)初始化赋值问题分为以下两种情况: 1.被static修饰符修饰:可以通过两种途径进行初始化赋值 ① 在常量被定义时进行初始化赋值 ② 在静态代码 ...