/etc/my.conf
[mysqld]
skip-grant-tables
mariadbの再起動
systemctl restart mariadb;
mysql
mysqlに接続してPasswordのハッシュを上書き
use user;
update user set Password = PASSWORD('password') where User = 'root';
flush privileges;
quit;
/etc/my.confの追加記述をコメントアウトしてmariadbを再起動
systemctl restart mariadb;
mysql -u root -p
identified by はユーザ作成時だけらしい・・・
ALTER USER 'root'@'localhost' identified BY 'hoge';