Skip to content

Instantly share code, notes, and snippets.

@abarth500
Last active August 29, 2015 14:23
Show Gist options
  • Save abarth500/6b3d270ef7940dae0869 to your computer and use it in GitHub Desktop.
Save abarth500/6b3d270ef7940dae0869 to your computer and use it in GitHub Desktop.
[情報科学実験I] MariaDBのrootパスワードリセット方法
# MariaDBのサービスを停める
sudo systemctl stop mariadb.service
#MariaDBをセーフモードで立ち上げる。
sudo mysqld_safe --skip-grant-tables &
#rootでログイン
mysql -u root
#rootのパスワードを設定(MariaDBのコマンドライン上で)
use mysql;
update user set password=PASSWORD("ここにパスワードを記述") where User='root';
flush privileges;
quit;
#セーフモードのMariaDBをkillするかリスタート
sudo reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment