mysql密码与授权的问题

我下载的5.7.16压缩包版的mysql。
但是第一次登陆在password那里按回车就显示:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
于是我在my.init文件里面加入了skip-grant-tables。
这样可以登陆进mysql咯。
但是就导致我无法为用户授权,也就是我无法为数据库设置密码,一设置就会显示:
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
这样该怎么处理啊?

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
表示你的登录的密码错误,你可以通过使用–no-defaults选项调用客户端程序来禁用选项文件。

或者用–skip-grant-tables重启 mysqld来更改密码。

参考自:MySQL拒绝访问错误的原因 http://www.data.5helpyou.com/article435.html

你应该给mysql设置密码。然后用密码登陆