我在运行 sudo **mysql_secure_installation**
时不断收到以下错误
... Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters.
我们将不胜感激。
更新:
通过运行 sudo mysql 解决了这个问题,它以 root 身份登录而没有密码,然后我运行了 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mynewpassword';
在此之后,我能够再次运行 mysql_secure_installation
,这次我必须选择使用现有密码(我使用上述 SQL 命令设置的密码)。
但是现在我不能再没有密码登录,运行 sudo mysql
现在拒绝 root 用户访问:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
如何再次使用 sudo mysql
重新登录?
最佳答案
我建议首先使用 select user,host from mysql.user;语句检查你的用户权限,然后进行相应的设置。从上面的错误来看,主要是权限的问题。
https://stackoverflow.com/questions/72334158/
相关文章:
css - 使用 FontAwesome 网络字体时的 CSP 警告(工具包)
laravel - 对 Laravel Controller 策略中的 $this->authori
database - 如何使用 LevelDB 访问 GoEthereum Transaction
ios - Firebase Messaging 不会在 iOS (11.4.1) 上调用 Back
docker-compose - 如何获取分离容器的 docker-compose exec 的控制
aws-lambda - 让 Alexa 通过自定义技能通过从后端调用任何 API 而不说 'Ale
r - 无法在 MacOS M1 Monterey 上安装 stringi R 包