Skip to content

Instantly share code, notes, and snippets.

@Khanashima
Created May 4, 2016 12:32
Show Gist options
  • Save Khanashima/fa03142385e1a26a30b0e961b224026b to your computer and use it in GitHub Desktop.
Save Khanashima/fa03142385e1a26a30b0e961b224026b to your computer and use it in GitHub Desktop.
MySQL ver5.7でrootのパスワードを忘れた場合の再設定方法 ref: http://qiita.com/kiimiiis/items/a8a47bc3065779e1dc0d
[root@vagrant-centos65 log]# service mysqld stop
[root@vagrant-centos65 log]# mysqld_safe --skip-grant-tables &
mysql> use mysql;
mysql> UPDATE mysql.user
-> SET authentication_string = PASSWORD('新パスワード'), password_expired = 'N'
-> WHERE User = 'root' AND Host = 'localhost';
mysql> FLUSH PRIVILEGES;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment