1.先停止mysql服务

service mysqld stop

2.启动mysql服务 并跳过权限认证

 mysqld_safe --skip-grant-tables

3.打开另外一个终端

登录mysql

[root@mysql ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.73 Source distribution Copyright (c) 2000, 2013, 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>

4.修改原来mysql的密码

update mysql.user set password=password("") where user = "root" and host = "127.0.0.1";
执行完sql语句 执行这条语句让sql语句生效
刷新数据表 刷新权限
flush privileges; 5.杀死刚才启动的mysql服务
pkill -9 mysql

6.开启mysql服务器

service mysqld start

 

最新文章

  1. Linux进程间通信(二):信号集函数 sigemptyset()、sigprocmask()、sigpending()、sigsuspend()
  2. WAMPserver配置(允许外部访问、phpmyadmin设置为输入用户名密码才可登录等)
  3. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3.1:
  4. 转,SelectNodes + XPath
  5. 安卓、swiper标准的文字滚动
  6. 【PHP】金额数字转换成大写形式
  7. http://phantomjs.org/page-automation.html
  8. Swing透明和变换
  9. VIJOS P1081 野生动物园 SBT、划分树模板
  10. mysql获取某个表的所有字段名
  11. centos7下kubernetes(18。kubernetes-健康检查)
  12. Tomcat 的 server.xml 文件详解
  13. 十二、存token获取token刷新token发送header头
  14. CSS margin属性取值
  15. spring mvc 实战化项目之三板斧
  16. springmvc 动态加载配置文件
  17. 【Spring】Spring中用到的设计模式
  18. iOS: UUID and SSKeyChain
  19. 最全Java学习路线图——Java学习指南
  20. docker 入门 (二)基本操作

热门文章

  1. C++ template —— 实例化和模板实参演绎(四)
  2. tp3.2 ajax 表单提交
  3. Python学习(24):Python面向对象(2)
  4. Objective-C官方文档 值和集合
  5. 【Laravel5】 定制错误页面
  6. Qt编写百度离线版人脸识别+比对+活体检测
  7. css笔记 - 张鑫旭css课程笔记之 absolute 篇
  8. 【分享】Linux(Ubuntu)下如何自己编译JDK
  9. android make-standalone-toolchain.sh 使用说明
  10. Matlab当中size() length()等函数讲解