mysql --ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

这个问题首先网上的都是using password :yes ,然后我发现我的是no ,但是目前我还没有发现有什么区别,等后续用的多了,再来update

解决方案:

vim /etc/my.cnf

添加

[mysqld]

skip-grant-tables

(因为我发现百度上的人都是自己就有mysqld ,本来我是直接follow 他们直接加了skip ,但是没有生效,于是另外加上了[mysqld])

 

 最后

[root@localhost ~]# systemctl restart mysqld.service  --> 重新启动mysql service 
[root@localhost ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.13 Source distribution

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit;
Bye

 

posted @   正霜霜儿  阅读(79)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
点击右上角即可分享
微信分享提示