4

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 on linux

I tried to add it but I dont know its data-type How can I fix this

6

From the 5.7.6 release notes:

If you upgrade to this release of MySQL from an earlier version, you must run mysql_upgrade (and restart the server) to incorporate the changes to the mysql database. mysql_upgrade moves Password column values to the authentication_string column and removes the Password column. For nonupgraded installations that have no account_locked column, the server treats all accounts as unlocked, and attempts to lock or unlock and account produce an error.

Although you will find similar issues in every upgrade, so running this tool is a must. password_last_change was added in 5.7.4, so you must update the table definitions.

Please note that at the time, upgrades from 5.6 are supported, but not from 5.5 at the moment of writing these lines, so if you have upgraded directly from 5.5 or below you will likely find problems.

0

Never touch the system tables unless you know exactly what you are doing. Your are using the latest server that has changed a number of things for which MySQL Workbench needs to be adjusted. So, update to the latest version (6.3 RC is available, with GA around the corner).

  • how to update to the latest version, is it the same as myql_upgrade? how do I update it? – Ammar Jibarah Apr 5 '15 at 9:02
  • You are actually using MySQL Workbench? A tag indicates you would. – Mike Lischke Apr 5 '15 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.