6
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MySQL5.7でrootパスワード初期化変更メモ / 2017年10月

Posted at

パスワードを忘れたときに役立つ、rootパスワードを簡単初期化変更するためのメモです。
#初期化方法
1.MySQL停止
$ mysql.server stop

2.MySQL起動
$ mysql.server start --skip-grant-tables
→パスワード無しで接続可能

3.MySQLに接続
$ mysql

4.データベース選択
use mysql;

5.パスワードの更新```
update user set authentication_string=PASSWORD("新しいパスワードを記述") where User='root';
flush privileges;


6.MySQLを再起動

MySQLの接続解除
```quit;```
MySQL再起動```
$ mysql.server stop
$ mysql.server start
6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?