0
0

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 3 years have passed since last update.

MAMPでmysqlパスワード無しにする方法

Last updated at Posted at 2020-09-21

mysqlにログインし、パスワードを変更します。

mysql -u root -p
# mysqlにログイン

SET PASSWORD = password('新しいパスワード');
# '新しいパスワード'を設定

この状態では、phpMyAdminからログインできないため、config.inc.phpにそのための設定を追加します。

mdfind "config.inc.php" | grep "bin/phpMyAdmin/config.inc.php" | xargs code
# config.inc.phpの場所を検索して開く

config.inc.phpを'password'で検索すると次のような設定項目が見つかると思います。
パスワード無しを許可する行を追記してください。

$cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user']          = 'root';      // MySQL user
$cfg['Servers'][$i]['password']      = '';          // MySQL password (only needed
$cfg['Servers'][$i]['AllowNoPassword'] = true;      // パスワード無しを許可

これで設定は完了です。MAMP → OpenWebSitePage → Tools → phpMyAdminで、
データベースにアクセスできます。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?