2
1

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.

MAMPのMySQLのrootアカウントの初期パスワードは空ではない。

Last updated at Posted at 2019-01-21

備忘録として残します。
訳あって、xamppではなくmampをWindowsに入れて開発環境を構築することになりました。
xamppと違って初期セットはかなり楽かなと思いきや、rootのパスワード無でログインしようとしたら下記のようにエラー。

C:\MAMP\bin\mysql\bin>mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

なんやかんや調べてみたらどうやらxamppと違いrootユーザにもパスワードがちゃんと設定されている(空でない)とのこと。
パスワードもまたrootで設定されているようなので、改めてチャレンジ。
するとちゃんとログインできました。

C:\MAMP\bin\mysql\bin>mysql -u root -proot
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.6.34-log MySQL Community Server (GPL)

Copyright (c) 2000, 2016, 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>

調べてみるとrootに何も権限がないとか、いろいろ書かれていたが、phpmyadmin上でmysql.userのrootアカウントを見るとちゃんと全ての権限が付与されているため、ちょっと何言ってるかわからない状態になりました。

おまけにWindows版のMampの最新版4.1.0(2019/01/21現在)はPHP.iniを書き換えるとMysqlが次から起動できなくなるし、ほんとなんなんだ。

2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?