LoginSignup
11
8

More than 5 years have passed since last update.

Railsでmysqlにパスワードなしでアクセスできるように変更する

Posted at

はじめに

mysqlの再インストールをしたら、database.ymlにパスワードを書き込まないとDB作成ができなくなった。ローカルで開発している時は不便なので、パスワード不要に変更した。いずれまたハマりそうな気がするのでメモを残しておく。

手順

$ mysql -uroot -p
mysql> use mysql
mysql> update user set authentication_string=password("") where user='root'; 
mysql> flush privileges;
11
8
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
11
8