如何在Linux中重置MySQL root密码


当前第2页 返回上一页

更改密码后,停止mysql(在安全模式下运行)服务,并使用下面的命令重新启动它。

1

2

3

4

5

6

7

//基于SysVinit的系统

# service mysql stop

# service mysql start

 

//基于Systemd的系统

# systemctl stop mysql.service

# systemctl start mysql.service

步骤4:验证新密码

重新设置mysql root账号密码并重启后,只需登录验证新密码即可。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

# mysql -u root -p

 

Enter password: **********

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 29

Server version: 5.5.57 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>

本篇文章到这里就已经全部结束了,更多精彩内容大家可以关注php中文网的其他相关栏目教程!!!

以上就是如何在Linux中重置MySQL root密码的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

mysql中各种常见join连表查询实例总结

mysql date如何赋null

mysql中explain的使用以及性能分析

mysql多表联合查询

动力节点mysql基础视频教程的资源分享

mysql如何建立约束

mysql中的注意事项具体分析

mysql如何添加多行数据?

mysql架构设计思想详解

mysql使用变量实现各种排序实例详解

更多相关阅读请进入《mysql》频道 >>


数据库系统概念 第6版
书籍

数据库系统概念 第6版

机械工业出版社

本书主要讲述了数据模型、基于对象的数据库和XML、数据存储和查询、事务管理、体系结构等方面的内容。



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...