如何在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 如何搜索自增列

mysql日志文件有什么用

mysql无法连接出现错误提示10061怎么办

mysql怎么设置表名?

mysql怎么清空数据表数据

学习mysql如何优化查询速度

mysql怎么登录数据库连接

设计性能更优mysql数据库schema

mysql用户名怎么查看?

一文带你探究mysql中的null

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


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

数据库系统概念 第6版

机械工业出版社

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



打赏

取消

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

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

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

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

评论

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