linux 安装完mysql 密码重置
2024-08-31 18:12:06
If you have forgot the MySQL root password, can’t remember or want to break in….. you can reset themysql database password from the command line in either Linux or macOS Sierra and OSX as long as you know the root user password of the box you are on, this is for MySQL 5.7 onwards:
Stop MySQL
sudo /usr/local/mysql/support-files/mysql.server stop
Start it in safe mode:
sudo mysqld_safe --skip-grant-tables
This will be an ongoing command until the process is finished so open another shell/terminal window, and log in without a password as root:
mysql -u root
FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
Change the lowercase ‘MyNewPass’ to what you want – and keep the single quotes.
\q
Start MySQL
sudo /usr/local/mysql/support-files/mysql.server start
Thats it, now your root password will be updated.
Share this:
原文地址:https://coolestguidesontheplanet.com/how-to-change-the-mysql-root-password/
最新文章
- 点击ViewGroup时其子控件也变成pressed状态的原因分析及解决办法
- Mysql的视图、存储过程、函数、索引全解析
- VB6 GDI+ 入门教程[7] Graphics 其他内容
- 黄聪:如何删除wordpress登录之后wp_footer、wp_head自行加载的Open Sans字体、fonts.googleapis.com连接导致卡死的问题
- IDEA使用docker进行调试
- cocos2d-x 详解之 CCAction(动作)
- Jsp(3):内置对象和四种域对象的理解
- JS年月日三级联动下拉框日期选择代码
- 如何隐藏DLL中,导出函数的名称?
- Javascript内存泄漏
- js架构设计模式——从angularJS看MVVM
- 神经网络与深度学习笔记 Chapter 2.
- Python 数据分析Windows环境搭建
- 【Python实践-6】将不规范的英文名字,变为首字母大写,其他小写的规范名字
- 【C语言编程练习】5.12 兔子产仔问题
- Linux系统管理常用命令用法总结(2)
- mybatis知识点(已掌握)
- css 文本和div垂直居中方法汇总
- MySQL存储过程中的3种循环【转载】
- disconf-client-for-java