phpMyadmin 연결할 수 없음

4599 단어 MySQLphpMyadmin

소개



php를 학습하는 동안 mysql 버전을 UPDATE했을 때 발생한 오류입니다.
php, mysql 학습 중이며, 꽤 오르기 때문에 비망 로그로 남겨 둔다.

내 macOS 기기에서는 로컬 웹 개발에 MAMP 앱을 사용하고 있습니다. 그러나 phpMyAdmin 웹 페이지에 액세스하려고 할 때 다음 오류 메시지가 표시에서 시작되었습니다.

오류 내용





지금까지 phpMyadmin에 연결되어 있었지만 갑자기이 화면의 오류가 ...

에러 내용은 이런 느낌입니다.

1. 연결할 수 없음: 잘못된 설정


Cannot connect: invalid settings

2. 'localhost' 액세스가 거부되었습니다(암호 사용: YES)


mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)

3. 구성에서 호스트, 사용자 이름, 암호를 확인하고 MySQL 서버 관리자가 제공한 정보를 지원하는지 확인합니다.


phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

해결책



이 문제를 해결하려면 phpMyAdmin 구성 파일을 수정하고 MySQL 루트 사용자의 실제 암호를 사용하면 됩니다.
그냥 이걸로 했어요...

phpMyAdmin 구성 파일 설정



1. MAMP 앱이 실행 중이면 Stop Servers 버튼을 클릭하여 앱을 종료합니다.

2. Finder에서 폴더로 이동 Applications → MAMP → bin → phpMyAdmin.

3.config.inc.php 텍스트 편집기에서 파일을 엽니다.

4. 검색을 사용하여 다음 행을 찾습니다 (대략 87 행 당)
$cfg['Servers'][$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user']          = 'root';     // MySQL user

*'root'MySQLのrootユーザーの実際のパスワードに置き換えます。
$cfg['Servers'][$i]['password']      = 'root';     // MySQL password (

이제 phpMyAdmin 구성 파일 설정은 k!

MySQL 루트 사용자 설정



실제로, root 유저의 패스워드등을 잊어버린 분(Mysql8의 경우)은 이쪽 참고에
htps : // 이 m / 오 2314 / ms / 3 a 6c9, 5f9195c93 9

(보충) MySQL 8의 패스워드 인증 플러그인에 대해



MySQL에서는, 패스워드의 인증시에, 실행되는, 「authentication plugin」라고 하는 구조가 있습니다.

예를 들면 위의 커맨드로 설정한 패스워드에 대해서, 이하의 커멘드로, 확인할 수 있습니다.
mysql> select User, Plugin from mysql.user where User = 'root';
+------+-----------------------+
| User | Plugin                |
+------+-----------------------+
| root | caching_sha2_password |
+------+-----------------------+Copy

아래의 커멘드로 확인할 수 있듯이, MySQL8로부터는, 「caching_sha2_password」가 디폴트가 된 것 같습니다만··,
mysql > use mysql;
mysql > show variables like 'default_authentication_plugin';
+-------------------------------+-----------------------+
| Variable_name                 | Value                 |
+-------------------------------+-----------------------+
| default_authentication_plugin | caching_sha2_password |
+-------------------------------+-----------------------+Copy

mysql을 이용하는 클라이언트 소프트웨어(예를 들면, PhpMyAdmin등)에서는, 이 인증 방법을 서포트하고 있지 않기 때문에, 에러가 되어 로그인 할 수 없는 것이 있는 것 같습니다.

비밀번호를 아래의 명령으로 설정하면 피할 수 있습니다.
mysql> ALTER USER 'root'@'localhost' identified WITH mysql_native_password BY 'root';
Query OK, 0 rows affected (0.01 sec)

MAMP(pro) 설정 확인



여기
cahnge password of user"root":

비밀번호를 잘 맞추기


phpMyAdmin 웹 페이지 방문



https://localhost/phpMyAdmin/index.php
액세스할 수 있으면 완료됩니다.

마지막으로



이 오류를 통해 mysql 설정과 phpMyadmin 설정 방법이 조금이지만 익숙했습니다.
이 기사가 문제를 해결하는 데 도움이 되길 바랍니다.

참고 사이트
htps //mycy べるにゔぇrせ. 이 m / php 만 d 민 - ㅁ ls - 어세이 s - mysql. HTML

인증 플러그인 정보
htps //w w. s-sty ぇ. 이. jp/bぉg/2018/05/1807/

좋은 웹페이지 즐겨찾기