MySQL5.7.20报错Access denied for user 'root'@'localhost' (using password: NO)
在centos6.8上源码安装了MySQL5.7.20,进入mysql的时候报错如下:
解决办法如下:
在mysql的配置文件内加入:
vim /etc/my.cnf
skip-grant-tables
保存并重启mysql服务
进入mysql,修改密码:
mysql> use mysql;
mysql> update user set password=password("你的新密码") where user="root";
mysql> flush privileges;
mysql> quit
到此root账户就重置了密码,删除etc/my.cnf中,刚添加的那行内容,重启mysql就好了
如果在进行到
mysql> update user set password=password("你的新密码") where user="root";
报错:ERROR 1054 (42S22): Unknown column 'password' in 'field list'
解决措施如下:
mysql>desc user;
发现在Field列中没有password,此时我们需要这样重置密码:
mysql>update user set authentication_string=password('你的新密码') where user='root';
之后的步骤如上所示,就解决了这个问题
MySQL5.7.20报错Access denied for user 'root'@'localhost' (using password: NO)的更多相关文章
- 008-MySQL报错-Access denied for user 'root'@'localhost' (using password: NO)
1.新安装的mysql报错 MySQL报错-Access denied for user 'root'@'localhost' (using password: NO) 解决方案 1.先停掉原来的服务 ...
- 连接数据库报错Access denied for user 'root'@'localhost' (using password:YES)
报错信息为:pymysql.err.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using pa ...
- MySQL登录报错"Access denied for user 'root'@'localhost' (using password: YES)"
最近登录MySQL时候总报错: # mysql -uroot -p Enter password: ERROR (): Access denied for user 'root'@'localhost ...
- linux下mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”)的处理方法
最近登录某台服务器的mysql时候总报错: Access[root@log01 ~]# mysql -u root -p Enter password: ERROR 1045 (28000): Acc ...
- mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”)的处理方法
环境 CentosOS 6.5 ,已安装mysql 情景 root密码忘记,使用普通用户无法登录 解决 问题一 无法使用mysql命令 参考文章:https://www.cnblogs.com/com ...
- 运行JavaWeb项目报错Access denied for user 'root'@'localhost' (using password: YES)
问题重现:(以下讨论范围仅限Windows环境): C:\AppServ\MySQL> mysql -u root -p Enter password: ERROR 1045 (28000): ...
- 连接mysql报错Access denied for user 'root'@'localhost' (using password: YES)解决办法
1.打开MySQL目录下的my.ini文件,在文件的最后添加一行“skip-grant-tables”(免密码登录),保存并关闭文件,重启MySQL服务. 2.通过命令行进入MySQL的BIN目录,输 ...
- pycharm连接数据库报错Access denied for user 'root'@'localhost' (using password:YES),以及wampserver 2/3个服务器正在运行 问题
使用mysql版本为mysql5.7,参考下列 https://blog.csdn.net/qq_32969455/article/details/79051932 https://blog.csdn ...
- mysql登录报错“Access denied for user 'root'@'localhost' (using password: YES”的处理方法
使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码: 文件内容: [client]host = localhostuser = debian-sys-maint ...
随机推荐
- Microsoft SQL - 查询与更新
查询与更新(Query & Update) 转义引号 SQL语句中字符串只能使用单引号,如果需要转义,可用单引号转义单引号. 查询(Inquire) 以下公式中的c指代列名. 规则 1.查询语 ...
- JS调用函数时候加括号与只写函数名字的区别 fn与fn()的区别
经常见插件里面函数调用的时候只写个函数名字,不写函数参数,甚至连括号也不写,比如说: <!DOCTYPE html> <html> <head> <meta ...
- 查看oracle 用户执行的sql语句历史记录
select * from v$sqlarea t order by t.LAST_ACTIVE_TIME desc
- Listary的使用
前几天研究米老师语录之后,开始对工具的使用着迷.现在的慢是为了以后的快,所以现在研究的一些东西,是为了以后在工作中可以更加快速的提高效率. 最近找到了一款很不错的软件,Listary.想给小伙伴们介绍 ...
- Django:前后端分离后联调给前端传数据
实现前后端分离后,有了下面几点改变: 1.服务器一分为二,前后端分别部署,静态资源放在前端服务器,业务代码放在后的服务器 2.前端服务器需要接收Http请求(一般使用node.js) 3.前端服务器需 ...
- U盘文件系统格式
u盘文件系统主要有FAT32.NTFS两种 ● FAT32文件系统 FAT32使用4个字节(也就是32位)的空间来表示每个扇区(Sector)配置文件的情形,故称之为FAT32.FAT16的分区容量上 ...
- eclipse 迁移项目 乱码
eclipse 迁移项目总是乱码问题,网上解决都无非是把workspace.项目.文件等改成utf-8,但总是不好使,因为原来有的文件类型还是要改成原来的编码格式,可以使用文本工具如notepad打开 ...
- Razor视图基本语法
<!--Razor C#--> @for (int i = 0; i < 10; i++) { <baobao>good</baobao> } < ...
- python学习第11天 迭代器
函数的名称 闭包 迭代器 递归
- mysql:赋予用户权限、查看及修改端口号
一.mysql 赋给用户权限 grant all privileges on *.* to joe@localhost identified by '1'; flush privileges; 即用u ...