root权限丢失,重新修改root权限
mysql8免密登录mysql
mysqld --console --skip-grant-tables --shared-memory
查看所有权限
select * from mysql.user where User='root' and Host='localhost'\G;
修改权限
update mysql.user set Insert_priv='Y',Update_priv='Y',Delete_priv='Y' where User='root' and Host='localhost';
刷新权限并退出
flush privileges;
exit;