1.SET PASSWORD FOR root@"%" = PASSWORD('your_password');
SET PASSWORD FOR root@"localhost" = PASSWORD('your_password');
2.update user set password=PASSWORD('your_password') where user='root' and host ='%';
update user set password=PASSWORD('your_password') where user='root' and host ='localhost';