mysql密码和登录问题

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

解决办法:

#修改数据库root用户口令

# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

# /etc/init.d/mysqld restart
# mysql -uroot -p
Enter password:

mysql>


#使root用户可以远程登录
GRANT ALL PRIVILEGES ON *.* TO

作者: wangzh3   发布时间: 2011-06-14