成功后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