0

I consulted the oficial doc from MYSQL: https://dev.mysql.com/doc/refman/5.7/en/alter-user.html

But does not work.

I have to Alter the username from database User.

Example:

User database:

login: john password: 123

New name:

login: johny password:123

Is it possible?

Example in mysql panel:

enter image description here

If i change de Login name i can... All the privileges are maintained

Sérgio Thiago Mendonça
  • 1,161
  • 2
  • 13
  • 23

1 Answers1

0

open mysql and enter into the database with your username(john) and password(123) -

now enter the following commands :

use mysql;

update user set User='johny'  where User='john';

flush privileges;

And if you also want to change the password then -

again enter into database with your username and password

now enter the following commands :

use mysql;

update user set PASSWORD=password("updated password")  where User='johny';

flush privileges;
vishwampandya
  • 1,067
  • 11
  • 11
  • Gives the comment: "You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect. 0.00051 sec" – Sérgio Thiago Mendonça Jun 28 '19 at 16:14