MariaDB 10.4 이전 과 이후 root 패스워드 변경법

MariaDB 가 버젼이 올라가면서 기존의 user 테이블에 있던 사용자 정보가 view 테이블로 변경되면서
기존방법대로 root 패스워드를 수정하게되면 에러가 발생하게 된다.
1 MariaDb 10.4 이전 수정법
mysql -uroot -p 엔터

use mysql
SELECT Host, User, FROM user;
SELECT Host, User, FROM user;

UPDATE user SET password=password('변경할패스워드') WHERE user=root;

error 출력됨
ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or
column(s) or function(s) or definer/invoker of view lack rights to use them
ERROR 1356 (HY000): View 'mysql.user' references invalid table(s) or
column(s) or function(s) or definer/invoker of view lack rights to use them
기존의 mysql.user 테이블이 아니라 이젠 global_priv Table (view)로 변경됨
set password for 'root'@'localhost' = password('password');
flush privileges;
앞으로는 이와같이 변경하도록 하자
hit: 6

Leave a comment