MySQLでROOTユーザーにパスを設定するメモ

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('{password}');
SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('{password}');
SET PASSWORD FOR 'root'@'::1' = PASSWORD('{password}');

メンドイ場合は以下

UPDATE mysql.user SET Password=PASSWORD('{password}') WHERE User='root';
FLUSH PRIVILEGES;