mysql - mysql安全安装好像不安全
问题描述
成功后mysql_secure_installation
输出:
mysql_secure_installation
Enter current password for root (enter for none):
Switch to unix_socket authentication [Y/n] n
Change the root password? [Y/n] y
New password:
MyBullPassword
Re-enter new password:
MyBullPassword
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] n
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
当我运行时:
mysql -u root -p
我能够在没有密码甚至密码错误的情况下连接到 mysql,而不是“访问被拒绝”消息,我已连接到 MySQL 服务器。
所以我猜MySQL是不安全的
为什么?我究竟做错了什么?有可能是因为我以 root 身份连接到服务器吗?即使密码错误,mysql也会让我访问?
操作系统:Centos 8 MySQL:MariaDB 10.5.8
解决方案
您必须检查安装中的几件事:
- 套接字连接 - 它们是启用还是禁用
- 用户特定的配置
my.cnf
有很多信息如何执行这些检查以及如何解决您的问题 - How to disable MySQL root logins when no password is provided?
推荐阅读
- java - Apache Felix OSGi 错误:缺少要求 osgi.extender
- vba - What is the difference between modules and class modules in Access?
- regex - Regex extracting numeric & alpha separately
- python - Python Type Hints ignored
- php - 如何确定 500 错误并显示自定义错误消息
- html - 删除边框线并为备用表格行分配颜色?
- javascript - 关于 JavaScript 中未解析变量的 IntelliJ 警告
- reactjs - React 和 LocalStorage 重复数据问题
- angular - Angular 2+:组件样式不断影响其他组件
- sharepoint-online - 如何使用 CSOM 关键字查询在 SharePoint Online 中设置用户配置文件属性过滤器