在centos6.3_x64下安装mysql数据库,在修改密码时:
/usr/bin/mysqladmin -u root password ‘123456’
出现错误:
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
解决方法:
# service mysqld stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('123456') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit
# service mysqld start