MySQL unknown column 'password_last_changed'

余生颓废 提交于 2019-12-03 14:50:36

问题


When creating a user using this command:

create user 'foo'@localhost';

this error is shown:

ERROR 1054 (42S22): Unknown column 'password_last_changed' in 'mysql.user'

Using MySQL server version: 5.7.6

I tried to add it but I don't know its data-type How can I fix this?


回答1:


Apparently you upgraded your MySQL to 5.7 from an earlier version.

Column 'password_last_changed' used to exist in MySQL <5.7, but was removed since 5.7

If this is the case, you have to run 'mysql_upgrade' script to migrate some tables from the old version to the new one.

run

mysql_upgrade -u root -p

and enter your root password.

then you should have your problem solved



来源:https://stackoverflow.com/questions/29455181/mysql-unknown-column-password-last-changed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!