Change root password in mysql 5.7

In MySQL 5.7, the password field in mysql.user table field is removed. It is replaced authentication_string.

Steps:

1. First select mysql database, which stores users information.

mysql>use mysql;

2. And then show the tables. We will find the user table.

mysql> show tables;

3. To get user table fields:

mysql> describe user;

Here, we can find authentication_string field instead of Password.

ERROR 1054 (42S22): Unknown column 'Password' in 'field list' MySQL

4. Try below query to reset root password in MySQL 5.7 or later.

update user set authentication_string=password(‘XXXX’) where user=’root’;

or

5. Alternative method.

mysql> SET PASSWORD FOR ‘root’ = PASSWORD(‘new_password’);

Related Posts

CheapSexCams
Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Powered by k2schools