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的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 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_ ...

  4. 第二百八十九节,MySQL数据库-ORM之sqlalchemy模块操作数据库

    MySQL数据库-ORM之sqlalchemy模块操作数据库 sqlalchemy第三方模块 sqlalchemysqlalchemy是Python编程语言下的一款ORM框架,该框架建立在数据库API ...

  5. [MySQL数据库之记录的详细操作:增、改、删、单表查询、多表查询]

    [MySQL数据库之记录的详细操作:增.改.删.单表查询.多表查询] 记录详细操作 增.删.改 增: insert t1(字段1,字段2,字段3) values (值1,值2,值3), (值1,值2, ...

  6. [MySQL数据库之表的详细操作:存储引擎、表介绍、表字段之数据类型]

    [MySQL数据库之表的详细操作:存储引擎.表介绍.表字段之数据类型] 表的详细操作 存储引擎 mysql中建立的库======>文件夹 库中建立的表======>文件 用来存储数据的文件 ...

  7. 在Jena框架下基于MySQL数据库实现本体的存取操作

    在Jena框架下基于MySQL数据库实现本体的存取操作 转自:http://blog.csdn.net/jtz_mpp/article/details/6224311 最近在做一个基于本体的管理系统. ...

  8. MySQL 数据库修改登录密码

    MySQL 数据库修改登录密码.. -------- mysql修改密码 默认的密码为空:mysql -u root -p第一次更改密码:mysqladmin -uroot -p password x ...

  9. 访问远程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 ...

随机推荐

  1. ubuntu中查看AMD GPU 状态的办法

    lshw -c video 运行命令:glxinfo | grep rendering 如果结果是“yes”,证明显卡驱动已经成功安装. 如果提示有问题,可能是系统里面没有安装mesa-utils,安 ...

  2. 6.LINUX32位和64位系统的区别和选择

  3. 珍珠x

    题目描述 有n颗形状和大小都一致的珍珠,它们的重量都不相同.n为整数,所有的珍珠从1到n编号.你的任务是发现哪颗珍珠的重量刚好处于正中间,即在所有珍珠的重量中,该珍珠的重量列(n+1)/2位.下面给出 ...

  4. 我的docker笔记

    下面的链接全部是我在CSDN的关于docker的博文,我认为已经很是详细了,没有再次总结的必要性,特给出链接地址 docker容器技术基础 https://blog.csdn.net/zisefeiz ...

  5. JMS学习二(简单的ActiveMQ实例)

    下载安装ActiveMQ服务,下载地址当然可以去官网下载 http://activemq.apache.org/download-archives.html ActiveMQ安装很简单,下载解压后到b ...

  6. [CSP-S模拟测试]:表达式密码(模拟)

    题目传送门(内部题87) 输入格式 从文件$expression.in$中读入数据.输入一行,一个字符串$S$,表示原表达式,保证为合法表达式 输出格式 输出到文件$expression.out$中. ...

  7. 关于项目中的一些经验:封装activity、service的基类,封装数据对象

    经验一,将几个页面公用的数据,和方法进行封装,形成一个baseActivity的类: package com.ctbri.weather.control; import java.util.Array ...

  8. Future 和 CompletableFuture 异步任务 in Java

    Future 异步任务 定义Callable接口的实现 import java.util.concurrent.Callable; public class RealDataCallable impl ...

  9. 当出现no changes added to commit时如何正确使用git提交命令

    对于这个问题,最好的解决方法就是按如下步骤:1.到根目录下:git add .  :("."是必须要的)2.git commit -m "some word"3 ...

  10. 利用Eclipse CDT 阅读C/C++代码

    本文转自: https://xbgd.iteye.com/blog/1259544 常见阅读代码的工具有 , visual c++, visual studio + va(visual assista ...