Legacy/문제해결

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

Foo 2016. 5. 7. 22:40
728x90

노트북 새로 산 후 MYSQL 다시 설치하고 환경을 설정하던 중 비밀번호를 잘못 설정하여 바꾸려고 하던 중 문제 발생



mysql> UPDATE user set password=password("my_password123") WHERE user = 'root';

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



http://ra2kstar.tistory.com/57

기존에는 위 링크와 같은 방법으로 되었는데,

MYSQL 버전이 바뀌면서 user 테이블이 바뀐듯합니다.


대신 authentication_string 필드가 그 역할을 대신함


mysql> UPDATE user set authentication_string=password("my_password123") WHERE user = 'root';

Query OK, 1 row affected, 1 warning (0.00 sec)

Rows matched: 1  Changed: 1  Warnings: 1


mysql> flush privileges;

Query OK, 0 rows affected (0.02 sec)


해결 :)



하지만..


mysql> show databases;

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.


ㅠㅠ.. 또 다른 에러메시지


mysql> alter USER USER() IDENTIFIED BY 'rfid123';

Query OK, 0 rows affected (0.00 sec)


mysql> show tables;

ERROR 1046 (3D000): No database selected

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| sakila             |

| sys                |

| world              |

+--------------------+

6 rows in set (0.00 sec)


mysql>




https://dev.mysql.com/doc/refman/5.7/en/password-expiration-policy.html mysql 메뉴얼 보고 해결