方式1:
mysql>set password =password('你的密码'); mysql>flush privileges;
方式2:
mysql>use mysql; mysql>update user set password=password('你的密码') where user='root'; mysql>flush privileges;
方式3:
mysql>grant all on *.* to 'root'@'localhost' IDENTIFIED BY '你的密码'with grant option ; mysql>flush privileges;