문제 설명
비밀번호로 식별되지 않는 mysql 부여 권한 (mysql grant privileges without identified by password)
달릴 때:
mysql> grant all privileges on database.* to user@localhost;
반환:
Query OK, 0 rows affected (0.00 sec)
'비밀번호'로 식별"을 포함하지 않아 오류가 발생하지 않을까요?
사용자에게 이미 비밀번호가 있음을 명확히 하십시오.
참조 솔루션
방법 1:
To quote the documentation:
Without
IDENTIFIED BY
, the account password remains unchanged.
Since the account already exists, and has a password, and you don't want to change it, you should indeed not specify an identified by
clause.
방법 2:
5.5 or newer versions of MySQL you should confirm that a command like grant all privileges on database.* to user@'10.1.1.12;
actual does what you want. I'm seeing it create a user without a password, that is you can login with an empty password.
(by Nabeel Khan、Mureinik、Brian C.)