>mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.7.18-log MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use mysql;
Database changed
mysql> select User from user;  #此处为查询用户命令
+-----------+
| User      |
+-----------+
| *******  |
| mysql.sys |
| root      |
+-----------+
3 rows in set (0.00 sec)

mysql> update user set password=password("*******") where user="*******";  #修改密码报错  (版本不同  我用这个成功了)
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
mysql> update mysql.user set authentication_string=password('*******') where user='*******';  #修改密码成功
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1

mysql> flush privileges;  #立即生效
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

n>mysql -u ******* -p #以该用户登录成功.
Enter password: ********
…………………………
mysql>

Linux下mysql 忘记密码的解决办法的更多相关文章

  1. Windows下mysql忘记密码的解决方法

    Windows下mysql忘记密码的解决方法 mysql5.0 http://www.jb51.net/article/21984.htm方法一: 1.在DOS窗口下输入 net stop mysql ...

  2. Linux下MySQL忘记密码

    系统:CentOS6.6 64位 参考文档(截图请看原网址): Linux下MySQL忘记root密码怎么办_百度经验 http://jingyan.baidu.com/article/1709ad8 ...

  3. mysql忘记密码的解决办法

    mysql忘记密码时,需要重设密码. 在Windows下的操作如下: 1.关闭正在运行的MySQL. 2.打开DOS窗口,转到mysql\bin目录. 3.输入mysqld --skip-grant- ...

  4. linux下mysql忘记密码解决方案

    一.写随笔的原因:之前自己服务器上的mysql很久不用了,忘记了密码,所以写一下解决方案,以供以后参考 二.具体的内容: 1. 检查mysql服务是否启动,如果启动,关闭mysql服务 运行命令:ps ...

  5. linux下mysql忘记密码的解决方案

    1.首先确认服务器出于安全的状态,也就是没有人能够任意地连接MySQL数据库.  因为在重新设置MySQL的root密码的期间,MySQL数据库完全出于没有密码保护的  状态下,其他的用户也可以任意地 ...

  6. linux下mysql忘记密码怎么办

    前言 今天在服务器安装mysql之后,登录发现密码错误,但是我没有设置密码呀,最后百度之后得知,mysql在5.7版本之后会自动创建一个初始密码. 报错如下: [root@mytestlnx02 ~] ...

  7. Linux 下 Mysql忘记密码重置

    1.修改配置文件 /etc/my.cnf 在[mysqld]下 加入skip-grant-tables 2.重启mysql 命令:service mysqld restart 3.等待几分钟后 就可以 ...

  8. linux 下mysql忘记密码或者安装好linux后不知道mysql初始密码解决方案

    1.使用yum安装mysql后 2.初始密码在/var/log/mysqld.log这个文件里 3.输入命令:grep 'temporary password' /var/log/mysqld.log ...

  9. linux下mysql忘记root密码怎么办

    Linux下MySQL忘记root密码怎么办? Linux下MySQL忘记root密码怎么办? 1. 修改MySQL配置文件 默认MySQL的配置文件为/etc/my.cnf,在[mysqld]下面添 ...

随机推荐

  1. unity font研究小结

    项目用ngui制作的界面.字体使用了unity默认的Arial,公布后在一些android手机上发现中文不显示,就此作了一些调查. 參考unity的font说明文档:http://docs.unity ...

  2. URAL 1826. Minefield(数学 递归)

    题目链接:http://acm.timus.ru/problem.aspx? space=1&num=1826 1826. Minefield Time limit: 0.5 second M ...

  3. Java图形界面(GUI)——如何将JTable成功放入面板

    在这次课程设计中,大部分内容都设计的很流畅,没有遇到太大的问题,但在面板中加入JTable时确实花费了一部分时间,在此将解决办法总结出来: 定义控件: JPanel panel = new JPane ...

  4. PHP之实现双向链表(代码篇)

    <?php/** * PHP之实现双向链表 */class Hero{ public $pre=null; public $no; public $name; public $next=null ...

  5. ProjectRuler 算法练习之 位数组成字符串同样的整数

    Problem :It can be seen that the number, 125874, and its double, 251748, contain exactly the same di ...

  6. c21---结构体

    // // main.c // 结构体基本概念 // #include <stdio.h> int main(int argc, const char * argv[]) { /* 基本数 ...

  7. 3-3 第三天 Promise 如何使用

    回调的方式来处理异步,目的是要保证一个执行顺序,先完成什么再去完成什么,它们的作用其实是相同的,显然回调更容易来书写,但是它难以维护,很容易遗漏错误处理代码而且无法使用return语句来返回这个值. ...

  8. 省市区js三级联动(原创)

    看了一些网上的js三级联动,但感觉不是缺这,就是少那,决定亲自操刀写了一个,现记录如下,以备后用! <!DOCTYPE html> <html> <head> &l ...

  9. VM虚拟机-Windows

    前提:安装了vm虚拟机 一.下载win10原版镜像文件 一定要是原版,修改版的不能用. 推荐下载网址:http://www.xitongtiandi.net/win10yuanban/ 下载后放在D盘 ...

  10. selenium 最大化浏览器是解决浏览器和驱动不匹配的方法如下

    那么要想selenium成功的操作chrome浏览器需要经历如下步骤: 1.下载ChromeDriver驱动包(下载地址: http://chromedriver.storage.googleapis ...