- MySQL 5.7.6 and later
--修改密码 -- 密码形式过于简单则会报错(密码要包括大写字母、小写字母、数字、特殊符号) ALTER USER 'root'@'localhost' identified BY '新密码'; ALTER USER 'root'@'%' identified BY '新密码';
- MySQL 5.7.5 and earlier
use mysql update user set password=password("new_pass") where user="root"; flush privileges; exit;