MYSQL没有初始密码解决方法

#/etc/init.d/mysql stop
#cd /usr/local/mysql
#mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
#mysql -u root mysql
mysql > UPPATE user SET password=PASSWORD('newpassword') where USER='root';
mysql > FLUSH PRIVILEGES;
mysql > quit ;
#/etc/init.d/mysql restart
#mysql -u root -p