一、以安全模式登录

# Stop MySQL
sudo service mysql stop # Make MySQL service directory.
sudo mkdir -p /var/run/mysqld # Give MySQL user permission to write to the service directory.
sudo chown mysql:mysql /var/run/mysqld # Start MySQL manually, without permission checks or networking.
sudo mysqld_safe --skip-grant-tables & # Log in without a password.
mysql -u root

二、修改密码

UPDATE mysql.user SET authentication_string=PASSWORD('NEW-PASSWORD'), plugin='mysql_native_password' WHERE User='root' ;
EXIT;

三、重启数据库

# Turn off MySQL.
sudo mysqladmin -S /var/run/mysqld/mysqld.sock shutdown # Start the MySQL service normally.
sudo service mysql start

最新文章

  1. 玩转Asp.net MVC 的八个扩展点
  2. 【BZOJ 1468】Tree 点分治
  3. char*或string转换成LPCWSTR
  4. 【转载】solr初体验
  5. 揭开UTF-8的神秘面纱
  6. JS学习笔记(四) 正则表达式(RegExp对象)
  7. thinkphp用phpexcel读取excel,并修改列中的值,再导出excel,带往excel里写入图片
  8. Downloading the Google Cloud Storage Client Library
  9. Jetty开发(2)
  10. NOI 能量采集
  11. HDU2504 又见GCD
  12. unity中怎样获取全部子物体的组件
  13. 轻松学习之Linux教程一 ubuntu14.04+windows双系统安装
  14. 编程算法 - 数丑陋 代码(C)
  15. 新服务器sudo与权限分配<NIOT>
  16. iOS动画编程
  17. 一个action读取另一个action里的session
  18. RabbitMQ学习3----运行和管理RabbitMQ
  19. Django ORM 使用原生 SQL
  20. 【centos7】 Failed to start LSB Bring up/down

热门文章

  1. C# 二分法查找和排序
  2. CCPC2016长春站打铁记
  3. Global Git ignore - Stack Overflow
  4. [Angular] Using ngOnChanges lifeCycle hook to break object reference
  5. 【codeforces 755C】PolandBall and Forest
  6. Android Studio 连接自己搭建的server 须要admin 的帐号的问题 SSH Password Login,please enter password for user git@git.
  7. 如何快糙好猛的使用libfacedetection库【最新版】
  8. 《iOS开发全然上手——使用iOS 7和Xcode 5开发移动与平板应用》之Objective-C新手训练营
  9. 汉高澳大利亚matrix矩阵计算器
  10. Adaptive partitioning scheduler for multiprocessing system