当前位置:网站首页>mysql误删root账户导致无法登录
mysql误删root账户导致无法登录
2022-07-03 06:51:00 【AquilaEAG】
在处理mysql远程登录时,误删mysql.user表中的root记录,导致退出后无法登录
解决办法:
1、vim /etc/my.cnf
增加:
[mysqld]
skip-grant-tables
2、重启mysql
systemctl restart mysqld
3、补救处理:
update user set Host='localhost',
select_priv='y',
insert_priv='y',
update_priv='y',
Alter_priv='y',
delete_priv='y',
create_priv='y',
drop_priv='y',
reload_priv='y',
shutdown_priv='y',
Process_priv='y',
file_priv='y',
grant_priv='y',
References_priv='y',
index_priv='y',
create_user_priv='y',
show_db_priv='y',
super_priv='y',
create_tmp_table_priv='y',
Lock_tables_priv='y',
execute_priv='y',
repl_slave_priv='y',
repl_client_priv='y',
create_view_priv='y',
show_view_priv='y',
create_routine_priv='y',
alter_routine_priv='y',
create_user_priv='y'
where user='root';
flush privileges;
4、重启mysql
systemctl restart mysqld
5、MySQL5.7版本密码设置
MySQL 设置的密码中必须至少包含一个大写字母、一个小写字母、一个特殊符号、一个数字,
密码长度至少为8个字符
边栏推荐
- Machine learning | simple but feature standardization methods that can improve the effect of the model (comparison and analysis of robustscaler, minmaxscaler, standardscaler)
- Read blog type data from mysql, Chinese garbled code - solved
- mongodb
- 堆排序和优先队列
- Class and object summary
- 10万奖金被瓜分,快来认识这位上榜者里的“乘风破浪的姐姐”
- Floating menu operation
- Simple password lock
- Shell conditional statement
- DBNet:具有可微分二值化的实时场景文本检测
猜你喜欢

The 10000 hour rule won't make you a master programmer, but at least it's a good starting point

Golang operation redis: write and read hash type data

IC_EDA_ALL虚拟机(丰富版):questasim、vivado、vcs、verdi、dc、pt、spyglass、icc2、synplify、INCISIVE、IC617、MMSIM、工艺库

【类和对象】深入浅出类和对象

Selenium - by changing the window size, the width, height and length of different models will be different

Practice of enterprise ab/testing platform

VMware virtual machine C disk expansion
![[classes and objects] explain classes and objects in simple terms](/img/41/250457530880dfe3728432c2ccd50b.png)
[classes and objects] explain classes and objects in simple terms

Numerical method for solving optimal control problem (I) -- gradient method

How to migrate or replicate VMware virtual machine systems
随机推荐
Interface test weather API
2022 - 06 - 23 vgmp - OSPF - Inter - Domain Security Policy - nat Policy (Update)
mongodb
Code management tools
New knowledge! The virtual machine network card causes your DNS resolution to slow down
Request weather interface format, automation
Getting started with pytest
这两种驱蚊成份对宝宝有害,有宝宝的家庭,选购驱蚊产品要注意
Simple understanding of bubble sorting
HMS core helps baby bus show high-quality children's digital content to global developers
Integration test practice (1) theoretical basis
On the practice of performance optimization and stability guarantee
VMware virtual machine C disk expansion
Machine learning | simple but feature standardization methods that can improve the effect of the model (comparison and analysis of robustscaler, minmaxscaler, standardscaler)
Journal quotidien des questions (11)
Unit test notes
方差迭代公式推导
How to plan well?
Practical plug-ins in idea
Abstract learning