1

Does the following command:

GRANT ALL PRIVILEGES ON myblog.* TO "wordpress"@"localhost" IDENTIFIED BY "summer";

If executed, set a new password, when there is already an existing user wordpress with password winter?

Kai
  • 38,985
  • 14
  • 88
  • 103
user1145216
  • 2,434
  • 3
  • 15
  • 14

2 Answers2

3

Yes, it does.

When the IDENTIFIED BY clause is present and you have global grant privileges, the password becomes the new password for the account, even if the account exists and already has a password. With no IDENTIFIED BY clause, the account password remains unchanged.

Quoted from MySQL documentation

Sergey Kudriavtsev
  • 10,328
  • 4
  • 43
  • 68
0

When the IDENTIFIED BY clause is present and you have global grant privileges, the password becomes the new password for the account, even if the account exists and already has a password. With no IDENTIFIED BY clause, the account password remains unchanged.

From: MySql doc

DonCallisto
  • 29,419
  • 9
  • 72
  • 100