UFO ET IT

phpMyAdmin에 대한 사용자 'root'@ 'localhost'에 대한 액세스 거부 수정

ufoet 2020. 11. 26. 20:25
반응형

phpMyAdmin에 대한 사용자 'root'@ 'localhost'에 대한 액세스 거부 수정


PC에서 WAMP Server 2.2를 사용하고 있습니다. phpMyAdmin (버전 5.5.24)에서 'root'사용자 ( 'localhost'호스트 사용)를 편집하고 'root'암호를 부여했습니다. 이것은 내가 되돌리려는 큰 실수로 판명되었습니다. 이제 localhost / phpmyadmin /으로 이동 하면 왼쪽에 데이터베이스 메뉴가 표시되지만 메인 프레임에는 다음과 같은 오류가 있습니다.

#1045 - Access denied for user 'root'@'localhost' (using password: NO)
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.

127.0.0.1/phpmyadmin으로 이동 하면 오류가 발생 하지 않고 모든 것이 잘 작동합니다.

사용자의 암호를 다시 암호 없음으로 변경하려고했습니다. 새 암호를 추가하기 위해 config.inc.php 파일을 수정하려고 시도했지만 phpMyAdmin 오류가 완전히 발생했습니다. 루트 / 로컬 호스트 사용자를 제거하고 다시 만들려고했습니다. 아무것도 작동하지 않는 것 같습니다. root / localhost 사용자는 암호가없고 모든 권한이있는 것처럼 보이지만 오류는 남아 있습니다.

WAMP를 다시 설치하지 않고도이 사용자의 액세스 권한을 정상으로 되돌릴 수있는 방법이나 아이디어가 있습니까?


찾기 config.inc에서 파일을 C:\wamp\apps\phpmyadmin3.5.1내부하면이 파일이 하나 개의 라인을 찾을 수

$cfg['Servers'][$i]['password'] =";

그리고 그것을

$cfg['Servers'][$i]['password'] = 'Type your root password here';

데이터베이스에서 비밀번호를 변경 한 후에도 동일한 문제가 발생했습니다. 내가 한 일은 이전에 변경 한 업데이트 된 비밀번호를 편집하는 것이었고 config.inc.php에서 업데이트하지 않았고 D 에서 동일한 사용자 이름을 사용했습니다 . \ xamp \ phpMyAdmin \ config.inc

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = **'root'**;
$cfg['Servers'][$i]['password'] = **'epufhy**';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

phpMyAdmin 페이지에서 "루트"의 비밀번호를 변경 한 후 동일한 문제가 발생했고 인터넷에서 솔루션을 찾았지만 필요한 답변을 얻지 못해 phpMyAdmin 디렉토리 내의 문서를 확인했습니다.

파일로 이동하여 편집

\modules\phpmyadmin414x140123114237\config.sample.inc.php

줄을 찾아

$cfg['Servers'][$i]['auth_type'] = 'config'

'config''http '변경하면 브라우저를 사용하여 phpMyAdmin 페이지로 이동할 때 사용자 이름과 비밀번호를 입력 할 수 있습니다.

또는

도움말을 보려면 동일한 phpMyAdmin 디렉토리 ( phpmyadmin414x140123114237\doc\html)에 있는 설명서 파일을 참조 하고 검색 $cfg['Servers'][$i]['auth_type']하면 phpMyAdmin 페이지에 로그인하는 방법에 대해 선택할 수있는 4 가지 옵션이 표시됩니다.


C : \ xampp \ phpMyAdmin에서 config.inc.php 파일을 찾아 아무 편집기에서나 엽니 다. 다음 줄을 찾으십시오.

$cfg['Servers'][$i]['password'] = '  ';

따옴표 안에 선택한 비밀번호를 입력하십시오. 또한 localhost / phpmyadmin이 사용자 이름과 암호를 요청하도록하려면 다음 줄을 찾으십시오.

$cfg['Servers'][$i]['auth_type'] = 'config';

위 줄을 다음과 같이 변경하십시오.

$cfg['Servers'][$i]['auth_type'] = 'cookie';

글쎄 .. 나에게는 매우 이상해 보이지만 갑자기 효과가 있었다 !!

내가 정확히 한 것은 :

  1. phpMyAdmin 폴더로 이동하여 "config.inc.php"파일을 편집했습니다.
  2. 줄을 찾았습니다. $ cfg [ 'Servers'] [$ i] [ 'password'] = '';
  3. ''사이에 비밀번호를 추가했습니다. '1234'라고 가정 해 보겠습니다.
  4. localhost / phpmyadmin 및 127.0.0.1/phpmyadmin을 다시로드했습니다 (둘 다 동일한 오류를 표시 함).
  5. "config.inc.php"를 이전 상태로 되돌 렸습니다 (비밀번호 제거).
  6. 4 단계를 다시 수행했습니다.

그리고 갑자기 작동했습니다!


사용 $cfg['Servers'][$i]['auth_type'] = 'config';은 안전하지 않다고 생각합니다.

쿠키를 사용하는 $cfg['Servers'][$i]['auth_type'] = 'cookie';것이 더 좋습니다.

또한 다음을 추가했습니다.

$cfg['LoginCookieRecall'] = true;

$cfg['LoginCookieValidity'] = 100440;

$cfg['LoginCookieStore'] = 0;  //Define how long login cookie should be stored in browser. Default 0 means that it will be kept for existing session. This is recommended for not trusted environments.
$cfg['LoginCookieDeleteAll'] = true; //If enabled (default), logout deletes cookies for all servers, otherwise only for current one. Setting this to false makes it easy to forget to log out from other server, when you are using more of them.

나는 이것을 phi.ini에 추가했습니다.

session.gc_maxlifetime=150000

mysql에 대한 기존 비밀번호가있는 경우 아래에 언급 된대로 작성하십시오.

C : \ wamp \ apps \ phpmyadmin3.5.1 아래에서 config (dot) inc 파일을 찾습니다.이 파일 내에서이 한 줄을 찾습니다.

$cfg['Servers'][$i]['password'] =";

그리고 그것을

$cfg['Servers'][$i]['password'] = **'your-password'**;


@Dagon은 올바른 아이디어를 가지고 있었지만 세부 사항은 약간 짧았습니다.

액세스를 사용하고 127.0.0.1/phpmyadminMysQL에 설정된 사용자를 자세히 살펴보면 사용자 root이름의 3 가지 버전이 표시 됩니다.

이는 MySQL에서 각 사용자 ID가 HOST, 즉 사용자가 로그인 할 수있는 PC (ip 주소)와 연결되기 때문입니다. 따라서 3 개의` 'root'사용자 ID는 실제로 3 개의 개별 HOSTS에서 로그인 할 수있는 동일한 사용자 ID입니다. 일반적으로 '루트'에는 3 개의 HOSTS 설정, 127.0.0.1, localhost 및 :: 1이 있습니다.

이것들은 :-

localhost는 HOSTS 파일 (c : \ windows \ system32 \ drivers \ etc \ hosts)에서 생성 된 THIS MACHINE의 별칭입니다.

127.0.0.1은이 시스템의 IPv4 루프백 IP 주소입니다.

:: 1은이 시스템의 IPv6 루프백 IP 주소입니다.

아마도 당신에게 일어나는 일은 root@127.0.0.1에 대한 암호를 설정했지만 다른 암호는 설정하지 않았기 때문입니다. 이제 브라우저가 호스트 IP로 :: 1 또는 127.0.0.1을 '임의로'사용하기로 결정하므로 :: 1을 사용하면 로그인이 실패합니다.

따라서 127.0.0.1/phpmyadmin3 개의 '루트'사용자 이름을 모두 사용하여 로그인 하고 동일한 암호를 갖도록 변경하면 더 이상이 문제가 발생하지 않습니다.

또한 HOSTS 파일에 다음 두 항목이 있는지 확인하십시오.

127.0.0.1  localhost
::1        localhost

위의 오류를 해결하려면 :-

a)  Open Mysql console from the tray of WAMP server

b)  It will ask for password(you might have set this password earlier when u installed MySql in your system)(In my case it is admin)

c)  Enter admin (press enter)

이제 phpmyadmin이 MySql에 대한 암호가 없다고 가정하고 MySql에 연결할 수 없지만 암호를 제공하여 MySql 서버에 연결할 수 있음을 의미합니다.

For this Open config.inc file from the below path
C:\wamp\apps\phpmyadmin4.1.14

And replace this line

$cfg['Servers'][$i]['password'] =’ ’;
to `$cfg['Servers'][$i]['password'] = 'admin';`

I hope it will work..


What worked for me:

Go to config.inc.php

Change $cfg['Servers'][$i]['AllowNoPassword'] = true; to $cfg['Servers'][$i]['AllowNoPassword'] = false;

Change $cfg['Servers'][$i]['password'] = '';

to

$cfg['Servers'][$i]['password'] = ' ';

Change

$cfg['Servers'][$i]['auth_type'] = 'config';

to

$cfg['Servers'][$i]['auth_type'] = 'http';

Reload the page http://localhost/phpmyadmin

Type : root pass : (empty)

Now you have access to it. :)


I use this URL to enter phpMyAdmin http://localhost:2145/phpmyadmin but get the following error:
"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"
my config.inc.php file is

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['host'] = 'localhost:2145';
$cfg['Servers'][$i]['connect_type'] = 'cookie';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
$cfg['Servers'][$i]['controluser'] = '';
$cfg['Servers'][$i]['controlpass'] = '';

this change resolve the mistake for me

$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;

and then

sudo service mysql stop
/opt/lampp/lampp start

and problem solved


xampp\phpMyAdmin/config.inc

Find-

$cfg['Servers'][$i]['auth_type'] = 'config'

and change the 'config' to 'http' and that will allow you to type the user name and password when you go to your phpMyAdmin page using your browser.


Also beware that "setup" (i.e. localhost/phpmyadmin/setup) has an error in the way it handles the "no password" option. While it creates a line that says:

$cfg['Servers'][$i]['nopassword'] = true;

the actual name of the parameter should be as shown here:

$cfg['Servers'][$i]['AllowNoPassword'] = true;

This "setup" error exists as of today, Oct 20, 2015.


Try to find $cfg['Servers'][$i]['password'] = ''; in config file located wamp/scripts/config.inc.php

Then set the password to your mysql password and refresh PhpmyAdmin


i also faced this problem,

i found password field was blank in config file of phpmyadmin. i put that password which i filled in database settings. now it is working fine

참고URL : https://stackoverflow.com/questions/19482371/fix-access-denied-for-user-rootlocalhost-for-phpmyadmin

반응형