linux - mysql 异常:ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
问题描述
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
备注:新安装完数据库后,在 xshell 上登录 mysql 后,运行 SQL 语句报如上错误
解决方案一
# /etc/init.d/mysql stop // 关闭 mysql
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql // 进入 mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root' and host='root' or host='localhost'; //把空的用户密码都修改成非空的密码就行了。
mysql> FLUSH PRIVILEGES;
mysql> quit # /etc/init.d/mysqld restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
解决方案二
mysql> SET PASSWORD = PASSWORD('123456'); // 用这句话重新设置一次密码,就可以了
备注
方案一、二可以搭配使用,先用一,再用二
linux - mysql 异常:ERROR 1820 (HY000): You must SET PASSWORD before executing this statement的更多相关文章
- mysql安装过程中出现错误ERROR 1820 (HY000): You must SET PASSWORD before executing this statement解决
mysql安装过程中出现错误ERROR 1820 (HY000): You must SET PASSWORD before executing this statement解决 最近新装好的my ...
- ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
Linux rpm方式安装完MySQL之后 mysql>SET PASSWORD = PASSWORD('newpasswd');
- 【MySQL】ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing
今天上午遇到了一个问题,新创建的mysql5.7的数据库,由于初始化有点问题,没有给root密码,用了免密码登录. 但是,修改了root密码之后,把配置中的免密登录的配置注释掉后,重启服务.服务正常启 ...
- 在linux安装mysql重启提示You must SET PASSWORD before executing this statement的解决方法
利用安全模式成功登陆,然后修改密码,等于给MySql设置了密码.登陆进去后,想查询所有存在的数据库测试下.得到的结果确实: ERROR 1820 (HY000): You must SET PASSW ...
- mysql 5.7 ERROR 1820 (HY000):
在首次登录Mysql 5.7 后,mysql数据库做出了很多的调整.执行大部分操作会提示这个错误 : ERROR 1820 (HY000): You must reset your password ...
- 第一次登录mysql,使用任何命令都报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
问题: 使用临时密码登录成功后,使用任何myql命令,例如show databases;都提示下面的报错 ERROR 1820 (HY000): You must reset your passwor ...
- MySQL用户密码过期登陆报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
今天接到主从复制失败告警,查看MySQL,发现MySQL能够登陆但是执行命令报错, ERROR 1820 (HY000): You must reset your password using ALT ...
- MySQL root账户密码设为“root”后执行命令提示ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
修改root账户密码为“root”后,提示ERROR 1820 (HY000): You must reset your password using ALTER USER statement bef ...
- MySQL:ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
解决方法: 修改密码:alter user 'root'@'localhost' identified by '123456'; mysql> use mysql; ERROR 1820 (HY ...
随机推荐
- 常见Linux命令学习
Linux命令学习 命令分类: 文件处理命令 权限管理命令 文件搜索命令 帮助命令 用户管理命令 压缩解压命令 网络命令 关机重启命令 1.文件处理命令 命令格式:命令 [-选项] [参数] 例:ls ...
- 传智播客C++视频学习笔记(1)
下载Visual Studio Community版本, #include<iostream> using namespace std; int main() { cout << ...
- ggEditor给节点增加提示框
参考官方文档: https://www.yuque.com/antv/g6/plugin.tool.tooltip 在react-ggEditor使用方法: import React from 're ...
- 诱人的 react 视频教程-基础篇(14 个视频)
诱人的 react 视频教程-基础篇(14 个视频) 诱人的 react 视频教程 - 基础篇 #1 介绍「07:25」 诱人的 react 视频教程 - 基础篇 #2 create-react-ap ...
- day9 修改文件
# 修改文件 # 文件是不能修改 with open('小护士班主任', mode='r', encoding='utf-') as f, open('小护士班主任.bak', 'w', encodi ...
- 数据结构(集合)学习之Queue
集合 框架关系图: Collection接口下面有三个子接口:List.Set.Queue.此篇是关于Queue<E>的简单学习总结. 补充:HashTable父类是Dictionary, ...
- [P5748] 集合划分计数 - 生成函数,NTT
求 \(10^5\) 以内的所有贝尔数:将 \(n\) 个有标号的球划分为若干非空集合的方案数 Solution 非空集合的指数生成函数为 \(F(x)=e^x-1\) 枚举一共用多少个集合,答案就是 ...
- 小程序公共模板template与公共js数据utils的引用实例
在小程序项目开发中,经常会遇到公共模板与公共js数据的调用,这里结合自己的项目为这一需求做一简单介绍 目录截图 现在是有一个评论版块需要在几个页面里共用 先将评论版块的wxml剔出来放在templat ...
- Interger对象不要用==进行比较
为了更好的空间和时间性能,Integer会缓存频繁使用的数值,数值范围为-128到127,在此范围内直接返回缓存值. IntegerCache.low 是-128,IntegerCache.high是
- 在Windows7中的各种显示模式中桌面图标的尺寸
在Windows7中的各种显示模式中,图标的尺寸 window7 桌面icon设计尺寸大小桌面图标设计尺寸一般是多少超大图标:256X256大图标:128X128中图标:32X32平铺:32X32列表 ...