#chrootuid /chroot/mysql mysql /usr/local/mysql/libexec/mysqld & #/usr/local/mysql/bin/mysql -uroot ....... mysql>SET PASSWord FOR root@localhost=PASSWORD('new_password');
要尽量养成在mysql下输入密码的习惯,因为Shell下面输入的时候可能会被其它人看见。
mysql>use mysql; mysql>update user set user="wghgreat" where user="root"; mysql>select Host,User,Password,Select_priv,Grant_priv from user; mysql>delete from user where user=''; mysql>delete from user where password=''; mysql>delete from user where host='%';