低于5.7的方式
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('新密码');
高于5.7的方式
ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';
低于5.7的方式
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('新密码');
高于5.7的方式
ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';