您的位置:首页 > 数据库 > MySQL

Mysql忘记密码解决方案

2017-10-11 18:29 190 查看
用命令跳过密码验证

mysqld -nt --skip-grant-tables

mysqld -nt --skip-grant-tables  --user=root &(权限报错的话,用这个)

mysql -u root

update mysql.user set authentication_string=password('you password') where user='root' and Host ='localhost'; 

如果报以下错误,解决方法

[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

(中文大意:强烈建议不要使用带有隐式默认值的TIMESTAMP。请使用explicit_defaults_for_timestamp选项)

官方网站相关说明:

As indicated by the warning, to turn off the nonstandard behaviors, enable the new
explicit_defaults_for_timestamp
 system
variable at server startup.

解决方案:
#开启查询缓存
explicit_defaults_for_timestamp=true
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: