MySQL·忘记密码
来源:互联网 发布:python隐马尔可夫模型 编辑:程序博客网 时间:2024/06/03 17:09
1、首先停止数据库
[root@localhost /]# systemctl stop mariadb.service
2、在my.cnf中加入skip-grant-tables
[root@localhost /]# vi etc/my.cnf
[mysqld]
skip-grant-tables
然后保存
[root@localhost /]# systemctl restart mariadb.service
3、进入mysql
[root@localhost /]# mysqlWelcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.35-MariaDB MariaDB Server
Copyright (c) 2000, 2013, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> use mysql
You can turn off this feature to get a quicker startup with -A
Database changed
4、update更新密码
MariaDB [mysql]> UPDATE user SET Password=password('123456')WHERE User='root';Query OK, 4 rows affected (0.01 sec)
Rows matched: 4 Changed: 4 Warnings: 0
MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)
MariaDB [mysql]> quit
Bye
5、在[mysqld]的段中删除或注释:skip-grant-tables
[mysqld]#skip-grant-tables
root@localhost /]# vi etc/my.cnf
[root@localhost /]# systemctl restart mariadb.service进入MySQL
[root@localhost /]# mysql -u root -p123456
Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 2
Server version: 5.5.35-MariaDB MariaDB Server
阅读全文
0 0
- MySQL·忘记密码
- MySQL忘记root密码
- mysql忘记密码
- mysql忘记密码
- 忘记mysql密码
- MySQL 忘记密码怎么办
- MySQL忘记密码怎么办
- MySQL忘记密码解决方法
- mysql忘记密码怎么办?~
- 忘记mysql超级管理员密码
- 忘记mysql密码解决方法
- 忘记mysql密码?[freebsd]
- Mysql密码忘记解决方案
- mysql 忘记密码怎么办
- mysql 忘记了密码
- MySQL忘记密码解决办法
- MySQL忘记密码解决方案
- MYSQL忘记root密码
- Error:The SDK Build Tools revision (23.0.3) is too low for project ':app'. Minimum required is 25.0.
- 掩膜 mask
- 一个简单的计算题
- u-boot 2013.04-rc1移植(6)
- 安卓传感器
- MySQL·忘记密码
- 每日练习_07
- AI时代取代手机:语音交互设计漫谈
- 6.3
- com.android.ddmlib.AdbCommandRejectedException: device offline Error while Installing APK解决
- 2017HCTF第一题WP
- 【Python】记录三:Spyder使用心得(持续更新)
- 使用注解+xml配置完成spring的bean的装配
- eclipse中xml 注释、格式化代码