装完的mysql默认密码是空的。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';
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';
再使用楼上的方法
使用mysqladmin -u root -p flush-privileges