Mysql忘记密码解决方案

来源:互联网 发布:荣威 知乎 编辑:程序博客网 时间:2024/05/20 05:46

用命令跳过密码验证

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 newexplicit_defaults_for_timestamp system variable at server startup.


解决方案:

#开启查询缓存explicit_defaults_for_timestamp=true

原创粉丝点击