修改mysql数据库root密码为空

人,唯一剥夺不了的,只有知识 / 2023-08-06 / 原文

use mysql
update user set authentication_string='' where user='root';

 

USE mysql;
UPDATE user SET authentication_string=PASSWORD('新密码') WHERE User='root';
FLUSH PRIVILEGES;