mysql服务器万能密码_Linux服务器---mysql忘记root密码
忘记root密码
如果不小心忘记了root密码,那么mysql就不能再登录了,这时就要重置root密码才行。通过下面的步骤,我们可以重新设置root密码。
1、退出mysql
[root@localhost src]# service mysqld stop
停止mysqld:[确定]
[root@localhost src]#
2、进入sql安全模式,命令“/usr/bin/mysqld_safe --skip-grant-table &”
[root@localhost src]#/usr/bin/mysqld_safe --skip-grant-table &
[1] 6332
[root@localhost src]# 180814 10:10:00 mysqld_safe Logging to '/var/log/mysqld.log'.
180814 10:10:00 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
3、无密码方式登录,命令“mysql –u root”
[root@localhost src]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.71 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,命令“use mysql;”
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql>
5、重设root密码,命令“update user set password=password (“密码”) where user=’root’”
mysql> update user set password=password('123456') where user='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql>
6、刷新
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
7、退出,重新登录
[root@localhost src]# mysql -u root -p
Enter password: //这里输入新密码
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Sever version: 5.1.71 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>
mysql服务器万能密码_Linux服务器---mysql忘记root密码相关推荐
- debian linux忘记密码,debian ubuntu linux 忘记root密码的重置方法
在前一章,讲了在 redhat/CentOS 等系统中,忘记 root 密码的重置方法,是修改 grub 里的 kernel 那一行,使其进入单用户,然后修改密码,可以这种方法,在 ubuntu 以及 ...
- linux 不知道root密码怎么办,linux下忘记root密码怎么办
在linux系统操作中,为了系统的安全,会给系统中的root账户设置密码,那么忘记密码是时常发生的事情.如果忘记了root的密码该怎么办呢?下面秋天网 Qiutian.ZqNF.Com小编就给大家介绍 ...
- red hat linux忘记root密码,Red Hat Linux忘记root密码的解决办法
Red Hat Linux忘记root密码的解决办法 Red Hat Linux忘记root密码的解决办法 1在出现系统选择界面时,在Red Hat Linux的选项上按"e"键, ...
- linux bios密码设置时间,linux忘记root密码及时间设定
文章来自网上整理还有个人总结 redhat 5恢复root用户的密码 开机按e进入编辑模式,选择内核把 kernel /vmlinuz-2.6.18-53.el5 ro root=/dev/VolGr ...
- linux7.4 root密码,[RHEL 7.4] 忘记root密码,普通用户又没有sudo权限,怎么办?
依云 说:在内核命令行上加 init=/bin/bash 然后进去改好密码,sync 之后长按电源键(或者拔电源)重启. 或者用 live 系统 chroot 进去改密码. 不好意思,我还是相当新的新 ...
- mysql忘记root密码及修改密码
方法1: 用SET PASSWORD命令 首先登录MySQL. 格式:mysql> set password for 用户名@localhost = password('新密码'); 例子 ...
- kali linux忘记开机密码,kali linux 忘记root密码重置办法
有段时间没用kali linux 的,加上最近装的系统有比较多,系统root的密码忘掉了,真是麻烦啊.之前在网上看到的一些方法尝试后没进的去,可能是因为不同的linux 不一样吧. 如果因为忘记密码而 ...
- RedFlag Linux忘记root密码解决办法
转于lee的http://hi.baidu.com/maozilee/item/12a62a76f371df2bd7a89c5d RedFlag Linux忘记root密码解决办法 Linux忘记ro ...
- linux mysql root免密_Linux下MySQL忘记root密码的完美解决方法
在使用MySQL数据库时,由于某些原因长时间没有登陆MySQL,或者由于工作交接完成度不高,导致数据库root登陆密码忘记,本文给大家介绍一种当忘记MySQL root密码时的解决办法,亲测有效. 首 ...
最新文章
- Shell---判断(if)和分支(case)
- HDU1899 Sum the K-th's(树状数组)
- python爬虫 发送定时气象预报
- oschina android版源码中的颜色值
- ARM 内核移植中常见的错误
- Linux 网络及IP概述
- 【转】智能音箱技术概览
- java java编码_Java编码约定被认为是有害的
- 23中设计模式之抽象工厂模式
- 使用jaxb根据xsd逆向生成java代码
- django-单表的增删改查-用户部门表
- postgresql interval 字段拼接
- 修改表结构的执行效率
- 《软件工程》网上书店项目需求规格说明书
- 程序员修炼之道——读序
- ubuntu18单机部署k8s(v1.14.1)
- 手机屏幕如何投屏到电脑显示器上?
- riscv-gnu-toolchain工具链的安装
- 如何给sqlserver 的表添加注释
- 国医大师王绵之:汤药煎服经验谈