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 ...
随机推荐
- Nginx之概念和简介
Nginx是什么? 代理服务器,处于客户端和服务器端之间的一台服务器,不负责处理请求. 主要作用是什么? 1.负载均衡: 高并发场景下,Nginx代理服务器按一定规则将请求分发,从而使服务器能有条不紊 ...
- BZOJ 4881: [Lydsy1705月赛]线段游戏 动态规划 + 线段树
Description quailty和tangjz正在玩一个关于线段的游戏.在平面上有n条线段,编号依次为1到n.其中第i条线段的两端点坐 标分别为(0,i)和(1,p_i),其中p_1,p_2,. ...
- PISCES: A Programmable, Protocol-Independent Software Switch
Name of article:PISCES: A Programmable, Protocol-Independent Software Switch Origin of the article:S ...
- (56)Linux驱动开发之二
内核基础 1.li ...
- 通过PPA存储库在UBUNTU或LINUX MINT中安装ORACLE JAVA 8 [JDK8]
http://www.webupd8.org/2012/09/install-oracle-java-8-in-ubuntu-via-ppa.html sudo add-apt-repository ...
- vue树形菜单
vue树形菜单 由于项目原因,没有使用ui框架上的树形菜单,所以自己动手并参考大佬的代码写了一个树形菜单的组件,话不多说,直接上代码.html代码js代码直接调用api 把请求到的数据直接赋值给per ...
- web编辑器的快捷键
alt 键:可以同时选中多个光标 .box 按住 tab 键 可以快速的 <div class="box"></div> #box 按住 tab 键 可以快 ...
- Python中的self用法之面向对象
class Student(object): def __init__(self, name, score): self.__name = name self.__score = score def ...
- 2、electron进程
electron核心我们可以分成2个部分,主进程和渲染进程. 主进程: 主进程连接着操作系统和渲染进程,可以把她看做页面和计算机沟通的桥梁. Electron 运行 package.json 的 ma ...
- python - assert 断言 语句
使用assert断言是学习python一个非常好的习惯,python assert 断言句语格式及用法很简单. 用法:在没完善一个程序之前,我们不知道程序在哪里会出错,与其让它在运行时崩溃,不如在出现 ...