LoginSignup
11
11

More than 5 years have passed since last update.

MySQLのrootパスワードの変更

Posted at

目的

  1. 開発用でパスワードなしで接続したいとき
  2. rootのパスワード変更したいとき

手順

$ mysql -uroot -p
Enter password:
mysql> use mysql
mysql> update user set password='' where User='root';
mysql> flush privileges;
$ mysql -uroot

出力結果

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 5.6.23 Homebrew

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 
11
11
1

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
11
11