当您在使用 “UPDATE user SET password=PASSWORD(‘newpassword’) WHERE User=‘root’;” 命令时提示 “ERROR 1356 (HY000): View ‘mysql.user’ references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them”,表明在您的 MariaDB 版本中,‘user’ 表已经不存在,由于版本不同的MariaDB解决方案也不同。
1.如果你的版本在10.4.4以上,你可以使用如下命令重置密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';
2.如果你的版本在10.4.4之前,你可以使用如下命令重置密码
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpassword');
记得重启mysql服务,并使用新密码登录MariaDB。文章来源:https://www.toymoban.com/news/detail-629795.html
建议您查询对应版本的MariaDB的文档,以文章来源地址https://www.toymoban.com/news/detail-629795.html
到了这里,关于mysql报错ERROR 1356 (HY000): View ‘mysql.user‘ references invalid table(s) or column(s) or function(s)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!