su
service mysqld stop
mysqld_safe --skip-grant-tables&
mysql -u root mysql
use mysql;
delete from user where user is null;
delete from user where user = '';
UPDATE user SET password=PASSWORD("1234") WHERE user='root';
UPDATE user SET host='localhost' where user='root' and host='%';
UPDATE user SET host='192.168.%.%' where user='root' and host='localhost.localdomain';
FLUSH PRIVILEGES;
select user,host,password from user;
exit;
service mysqld restart