重庆思庄Oracle、Redhat认证学习论坛
标题:
启动MYSQL报:[MY-000067] [Server] unknown variable 'validate_password_policy=2'
[打印本页]
作者:
郑全
时间:
2023-1-9 22:44
标题:
启动MYSQL报:[MY-000067] [Server] unknown variable 'validate_password_policy=2'
如题,在MYSQL8.0的配置文件中,加了cat /etc/my.cnf
...
validate_password_policy=2
...
结果重启MYSQL,就报无法启动,里面有下面的错误:
Jan 09 22:28:52 server1 mysqld[14493]: 2023-01-09T22:28:52.363853+08:00 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using --skip-symbolic-links (or equivalent) is the default. Consider not using thi
Jan 09 22:28:52 server1 mysqld[14493]: 2023-01-09T22:28:52.363972+08:00 0 [System] [MY-010116] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.31-commercial) starting as process 14493
Jan 09 22:28:52 server1 mysqld[14493]: 2023-01-09T22:28:52.378633+08:00 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
Jan 09 22:28:53 server1 mysqld[14493]: 2023-01-09T22:28:53.853286+08:00 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
Jan 09 22:28:54 server1 mysqld[14493]: 2023-01-09T22:28:54.040340+08:00 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
Jan 09 22:28:54 server1 mysqld[14493]: 2023-01-09T22:28:54.040410+08:00 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
Jan 09 22:28:54 server1 mysqld[14493]: 2023-01-09T22:28:54.042870+08:00 0 [ERROR] [MY-000067] [Server]
unknown variable 'validate_password_policy=2'.
Jan 09 22:28:54 server1 mysqld[14493]: 2023-01-09T22:28:54.042995+08:00 0 [ERROR] [MY-010119] [Server] Aborting
Jan 09 22:28:54 server1 mysqld[14493]: 2023-01-09T22:28:54.043140+08:00 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.
Jan 09 22:28:54 server1 systemd[1]: mysqld.service: control process exited, code=exited status=1
Jan 09 22:28:55 server1 mysqld[14493]: 2023-01-09T22:28:55.662083+08:00 0 [System] [MY-010910] [Server] /usr/local/mysql/bin/mysqld: Shutdown complete (mysqld 8.0.31-commercial) MySQL Enterprise Server - Commerci
Jan 09 22:28:55 server1 systemd[1]: Failed to start MySQL Server.
解决办法:
先从配置文件中去掉 参数:
validate_password_policy=2
再启动MYSQL
systemctl restart mysqld
然后登录MYSQL,安装
先检查一下,看看当前有没有口令验证插件没有
mysql> show plugins;
+----------------------------------+----------+--------------------+---------+-------------+
| Name | Status | Type | Library | License |
+----------------------------------+----------+--------------------+---------+-------------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | PROPRIETARY |
... ...
| ndb_transid_mysql_connection_map | DISABLED | INFORMATION SCHEMA | NULL | PROPRIETARY |
| ngram | ACTIVE | FTPARSER | NULL | PROPRIETARY |
| mysqlx_cache_cleaner | ACTIVE | AUDIT | NULL | PROPRIETARY |
| mysqlx | ACTIVE | DAEMON | NULL | PROPRIETARY |
+----------------------------------+----------+--------------------+---------+-------------+
48 rows in set (0.01 sec)
没有口令验证插件
安装口令验证插件
mysql> install plugin validate_password soname 'validate_password.so';
Query OK, 0 rows affected, 1 warning (0.01 sec)
再看插件:
mysql> show plugins;
+----------------------------------+----------+--------------------+----------------------+-------------+
| Name | Status | Type | Library | License |
+----------------------------------+----------+--------------------+----------------------+-------------+
| binlog | ACTIVE | STORAGE ENGINE | NULL | PROPRIETARY |
| mysql_native_password | ACTIVE | AUTHENTICATION | NULL | PROPRIETARY |
... ...
| mysqlx_cache_cleaner | ACTIVE | AUDIT | NULL | PROPRIETARY |
| mysqlx | ACTIVE | DAEMON | NULL | PROPRIETARY |
|
validate_password | ACTIVE | VALIDATE PASSWORD | validate_password.so | PROPRIETARY |
+----------------------------------+----------+--------------------+----------------------+-------------+
49 rows in set (0.00 sec)
已经有这个口令验证插件了。
检查与口令验证相关的参数:
mysql> show variables like 'validate%';
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password_check_user_name | ON |
| validate_password_dictionary_file | |
| validate_password_length | 16 |
| 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.01 sec)
mysql>
之后,再去参数文件中,增加 validate_password_policy=2 ,再启动不再报错。
附:
如果需要卸载口令验证插件:
mysql>
uninstall plugin validate_password;
欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/)
Powered by Discuz! X3.2