gpt4 book ai didi

MySQL 5.7.11 mysql_secure_installation 不工作

转载 作者:行者123 更新时间:2023-11-29 04:06:30 25 4
gpt4 key购买 nike

Linux 版本:Ubuntu 14.04.1 LTS服务器版本:5.7.11 MySQL Community Server (GPL)从以下链接下载: http://dev.mysql.com/downloads/repo/apt/

当我尝试运行 mysql_secure_installation我设置密码并重新加载所有已完成的任务。但是当我尝试登录 mysql 时,它不需要 root 用户的密码。

>>>mysql 


mysql> select * from user;
+-----------+-----------+-------------+-------------+-------------+---- ---------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-------------------------------------------+------------------+-----------------------+-------------------+----------------+
| Host | User | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv | Trigger_priv | Create_tablespace_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections | plugin | authentication_string | password_expired | password_last_changed | password_lifetime | account_locked |
+-----------+-----------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-------------------------------------------+------------------+-----------------------+-------------------+----------------+
| localhost | root | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | | | | | 0 | 0 | 0 | 0 | auth_socket | | N | 2016-02-08 15:54:07 | NULL | N |
| localhost | mysql.sys | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | N | | | | | 0 | 0 | 0 | 0 | mysql_native_password | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | N | 2016-02-08 15:54:08 | NULL | Y |
+-----------+-----------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-------------------------------------------+------------------+-----------------------+-------------------+----------------+
2 rows in set (0.00 sec)

不需要任何密码?

不知道为什么?

最佳答案

我认为问题出在plugin列的mysql.user,变量名是auth_socket。

https://dev.mysql.com/doc/refman/5.7/en/pluggable-authentication.html https://dev.mysql.com/doc/mysql-security-excerpt/5.5/en/socket-authentication-plugin.html

如果要更改mysql用户的身份验证,请按照以下步骤操作:

ALTER USER 'root'@'localhost' IDENTIFIED with mysql_native_password;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

这应该有效。

关于MySQL 5.7.11 mysql_secure_installation 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35264497/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com