LoginSignup
36
38

More than 5 years have passed since last update.

MySQL の root パスワード忘れた時

Last updated at Posted at 2014-11-20

MySQL止める

sudo /etc/init.d/mysqld stop

セーフモードで起動

sudo mysqld_safe --skip-grant-tables &

つなぐ

mysql -uroot

再設定

use mysql
update user set password=PASSWORD("ここにパスワードを記述") where User='root';
flush privileges;

起動

sudo /etc/init.d/mysqld stop
sudo /etc/init.d/mysqld start
36
38
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
36
38