mysql数据库问题———登录进去无法操作显示You must reset your password using ALTER USER statement before executing this statement
linux操作mysql数据库,可以登陆进去,但是操作所有命令都显示You must reset your password using ALTER USER statement before executing this statement,并且使用alter修改密码时,显示密码不符合权限
很多方法都没用,也不知道出了什么问题,我选择利用跳过密码登录后再次修改密码
解决过程:
1、编辑/etc/my.cnf
在[mysqld] 配置部分添加一行
skip-grant-tables
2、保存后重启mysql
[root@localhost etc]# service mysqld restart
Shutting down MySQL. [ OK ]
Starting MySQL. [ OK ]
3、登录数据库重新设置root密码
[root@localhost ~]# mysql -uroot -p mysql
Enter password:
直接回车进入
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.47-log Source distribution
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
+--------------------+
3 rows in set (0.00 sec)
成功进入,此时使用如下语句修改密码
UPDATE mysql.user SET authentication_string=PASSWORD('密码') where USER='root';
退出修改原来修改的文件,删除 /etc/my.cnf文件中添加的“skip-grant-tables”行,重启mysql;
用新设的密码就能正常登录了;
修改成功后,exit退出使用 mysql -uroot -p 命令 输入密码进入数据库,可以操作,
mysql数据库问题———登录进去无法操作显示You must reset your password using ALTER USER statement before executing this statement的更多相关文章
- MySQL数据库使用报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
今天MySQL数据库,在使用的过程中一直报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement be ...
- tar格式 方法安装MySQL后,初次登录出现 ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement
参考: https://www.cnblogs.com/kerrycode/p/4368312.html http://blog.csdn.net/u014520039/article/details ...
- mysql 设置不了短串密码怎么办 You must reset your password using ALTER USER statement before executing this statement.
centos7+ 安装 mysq 5.7 https://www.linuxidc.com/Linux/2016-09/135288.htm set global validate_password_ ...
- 第二百八十九节,MySQL数据库-ORM之sqlalchemy模块操作数据库
MySQL数据库-ORM之sqlalchemy模块操作数据库 sqlalchemy第三方模块 sqlalchemysqlalchemy是Python编程语言下的一款ORM框架,该框架建立在数据库API ...
- [MySQL数据库之记录的详细操作:增、改、删、单表查询、多表查询]
[MySQL数据库之记录的详细操作:增.改.删.单表查询.多表查询] 记录详细操作 增.删.改 增: insert t1(字段1,字段2,字段3) values (值1,值2,值3), (值1,值2, ...
- [MySQL数据库之表的详细操作:存储引擎、表介绍、表字段之数据类型]
[MySQL数据库之表的详细操作:存储引擎.表介绍.表字段之数据类型] 表的详细操作 存储引擎 mysql中建立的库======>文件夹 库中建立的表======>文件 用来存储数据的文件 ...
- 在Jena框架下基于MySQL数据库实现本体的存取操作
在Jena框架下基于MySQL数据库实现本体的存取操作 转自:http://blog.csdn.net/jtz_mpp/article/details/6224311 最近在做一个基于本体的管理系统. ...
- MySQL 数据库修改登录密码
MySQL 数据库修改登录密码.. -------- mysql修改密码 默认的密码为空:mysql -u root -p第一次更改密码:mysqladmin -uroot -p password x ...
- 访问远程mysql数据库,出现报错,显示“1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server“
在使用Navicat for MySQl访问远程mysql数据库,出现报错,显示“1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to t ...
随机推荐
- 用class语法派生Enum并增加描述值的类属性来定义一个新枚举
import enum class BugStatus(enum.Enum): new = 7 incomplete = 6 invalid = 5 wont_fix ...
- 【NOIP2016提高A组集训第13场11.11】最大匹配
题目 mhy12345学习了二分图匹配,二分图是一种特殊的图,其中的点可以分到两个集合中,使得相同的集合中的点两两没有连边. 图的"匹配"是指这个图的一个边集,里面的边两两不存在公 ...
- 【shell】sed后向引用替换文本
要求如下: 原文 <server name="92服" port="10092" os="android" hidden=" ...
- 各种注意事项(还有c++的一些操作)
转c++时间: 2017年8月9号 1.记得打头文件 2.=与==的区别(赋值|比较) 3.各种运算符的比较级(与Pascal不同),主要是==与位运算 *4.在OJ上scanf和printf时间优于 ...
- @ENABLECACHING 基于注解的缓存
@EnableCaching• @Cacheable指定一个或多个Cache名字,同属性cacheNamesSpring Cache 使用 ---@EnableCaching @Cacheable 注 ...
- PHP基础-表达式介绍
表达式是 PHP 最重要的基石.在PHP 编程 中,几乎所写的任何东西都是一个表达式.简单但却最精确的定义一个表达式的方式就是“任何有值的东西”. 最基本的表达式形式是常量和变量.当键入“$a = 5 ...
- Codeforces 950C Zebras ( 贪心 && 模拟 )
题意 : 给出一个 01 串,要求你将其分隔出若干个子序列 ( 每个数字只能属于某一个子序列 ) ,子序列必须满足由 0 开头和结尾,且中间需 01 交替构成.若无法做到,则输出 -1. 分析 : ...
- 微信浏览器video播放视频踩坑
video属性介绍 iOS的属性 playsinline On iPhone, video playsinline elements will now be allowed to play inlin ...
- go语言系列--golang在windows上的安装和开发环境goland的配置
在windows上安装golang软件 golang中国网址为:https://studygolang.com/dl 我的学习选择版本:1.12.5 golang 1.12.5版本更新的内容:gola ...
- Java字符串的不可变性
声明一个字符串引用变量: String s = "abcd"; s是一个引用变量,指向 堆内存中的字符串常量 "abcd" 再声明一个字符串引用变量: Str ...