Reset the Root Password of MySQL Server 리셋의 루트 비밀 번호를 반환한다
By default, MySQL Server will be installed with root superuser without any password. 기본적으로, 반환한다 루트 슈퍼유저없이 비밀 번호와 함께 설치됩니다. You can connect to MySQL server as root without requiring password or by keying in blank password. 루트로 연결할 수있습니다 반환한다 키에 의해 비밀 번호 또는 빈 암호를 필요로하지 않고있습니다. However, if you have set the password for root and forget or unable to recall the password, then you will need to reset the root password for MySQL. 그러나, 비밀 번호를 설정하는 경우에는 루트 및 비밀 번호를 잊어하거나 리콜 수없습니다, 그럼 당신의 루트에 대한 암호를 재설 정할 mysql이 필요합니다.
MySQL Reference Manual has detail steps on how to reset password for root which are as below: mysql 레퍼런스 매뉴얼은 비밀 번호를 다시 설정하는 방법에 대한 자세한 단계를 다음과 같이 루트가 :
The procedure under Windows: 아래의 절차 윈도우 :
- Log on to the Windows system where MySQL is running as Administrator. 창 체계에 로그온 관리자 권한으로이 실행되고있는 mysql합니다.
- Stop the MySQL server if it is running. 반환한다 실행중인 경우를 중지합니다. For a server that is running as a Windows service, go to the Services manager: windows를 실행하는 서버에 대한 서비스, 이동 서비스 매니저 :
Start Menu -> Control Panel -> Administrative Tools -> Services 시작 메뉴 -> 제어판 "-> 관리 도구 -> 서비스
Then find the MySQL service in the list, and stop it. 다음의 목록을 찾을 서비스에 mysql, 그리고 멈춰합니다.
If your server is not running as a service, you may need to use the Task Manager to force it to stop. 귀하의 서버가 서비스로 실행하지 않는 경우해야 할 수도있습니다을 사용하여 작업 관리자를 강제로 그것을 중지합니다.
- Create a text file and place the following command within it on a single line: 텍스트 파일을 만듭니다 다음과 같은 명령을 시간과 장소에 하나의 라인 :
SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(’MyNewPassword’); 비밀 번호를 설정 '루트'@ '로컬'= 비밀 번호 ( 'mynewpassword');
Save the file with any name. 임의의 이름에서 파일을 저장합니다. For this example the file will be C:\mysql-init.txt. 이 예제 파일은 c : \ mysql - init.txt합니다.
- Open a console window to get to the DOS command prompt: 콘솔 창을 열어 도스 명령 프롬프트를 얻기 위해선 :
Start Menu -> Run -> cmd 시작 메뉴 -> 실행 -> cmd
- If MySQL is installed in C:\mysql. mysql에 설치되어있는 경우 c : \ mysql합니다. If MySQL is installed in another location, adjust the following commands accordingly. 다른 위치에 mysql에 설치되어있는 경우, 다음과 같은 명령을 적절히 조절합니다.
At the DOS command prompt, execute this command: 도스에서 명령 프롬프트에서이 명령을 실행 :
C:\> C:\mysql\bin\mysqld-nt –init-file=C:\mysql-init.txt c : \> c : \ mysql \ 빈 \ mysqld - nt - init - 파일 = c : \ mysql - init.txt
The contents of the file named by the –init-file option are executed at server startup, changing the root password. 라는 이름의 파일의 내용을 - init - 파일 옵션을 실행하는 서버에서 시작, 루트 암호를 변경합니다. After the server has started successfully, you should delete C:\mysql-init.txt. 서버가 성공적으로 시작 후 삭제해야합니다 c : \ mysql - init.txt합니다.
If you installed MySQL using the MySQL Installation Wizard, you may need to specify a –defaults-file option: mysql을 설치한 경우 빠른 설치 마법사를 사용하는 경우 - 기본 - 파일 옵션을 지정해야합니다 :
C:\> “C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt.exe” c : \> "c : \ 프로그램 파일 \ mysql \ 반환한다 5.0 \ 빈 \ mysqld - nt.exe"
–defaults-file=”C:\Program Files\MySQL\MySQL Server 5.0\my.ini” - 기본 - 파일 = "c : \ 프로그램 파일 \ mysql \ 반환한다 5.0 \ my.ini"
–init-file=C:\mysql-init.txt - init - 파일 = c : \ mysql - init.txtThe appropriate –defaults-file setting can be found using the Services Manager: - 파일의 설정에 적절한 - 기본값을 사용하여 서비스 관리자를 찾을 수있습니다 :
Start Menu -> Control Panel -> Administrative Tools -> Services 시작 메뉴 -> 제어판 "-> 관리 도구 -> 서비스
Find the MySQL service in the list, right-click on it, and choose the Properties option. mysql 서비스를 찾을 목록에서 오른쪽 - 클릭하고 등록 정보 옵션을 선택합니다. The Path to executable field contains the –defaults-file setting. 필드에 대한 경로를 실행 파일 - 파일을 설정을 포함하는 -의 기본값합니다. Be sure to supply the –init-file argument with the full system path to the file, regardless of your current working directory - init - 파일을 제공하기 위해 반드시 인수를 파일의 전체 시스템 경로에 관계없이 귀하의 현재 작업 디렉토리
- Stop the MySQL server, then restart it in normal mode again. 반환한다 중지 후 다시 일반 모드에서 다시 시작합니다. If the MySQL server is ran as a service, start it from the Windows Services window. 이 경우에는 반환한다 몫 서비스로 서비스를 시작합니다들 창문에서 창문합니다. If you start the server manually, use whatever command you normally use. 서버를 수동으로 시작하는 경우, 어떤 명령을 사용 일반적으로 사용합니다.
- Connect to MySQL server by using the new password. 새 비밀 번호를 사용하여 연결을 반환한다.
For Unix environment, the procedure for resetting the root password is as follows: 유닉스 환경에서는 루트 암호를 재설 정한 절차에 대해는 다음과 같습니다 :
- Log on to the Unix system as either the Unix root user or as the same user that the mysqld server runs as. 유닉스 시스템에 로그온합니다 중 하나를 유닉스로 루트 사용자 또는 mysqld 서버에 같은 사용자로 실행을합니다.
- Locate the .pid file that contains the server’s process ID. 를 찾습니다. pid 파일이 들어있는 서버의 프로세스 번호합니다. The exact location and name of this file depend on your distribution, hostname, and configuration. 해당 파일의 정확한 위치와 이름에 따라 달라집니다 유통, 호스트 이름, 및 구성합니다. Common locations are /var/lib/mysql/, /var/run/mysqld/, and /usr/local/mysql/data/. 일반적인 위치는 / 변수 / lib / mysql /, / 변수 / 실행 / mysqld /, / usr / 지방 / mysql / 데이터 /합니다. Generally, the filename has the extension of .pid and begins with either mysqld or the system’s hostname. 일반적으로, 파일의 확장자를합니다. pid와 mysqld 중 하나 또는 시스템의 호스트로 시작합니다.
Stop the MySQL server by sending a normal kill (not kill -9) to the mysqld process, using the pathname of the .pid file in the following command: 정상적인 살해를 중지합니다 전송하여 반환한다 (죽이지 -9)을 mysqld 프로세스를 사용하여 경로를합니다. pid 파일에 다음과 같은 명령 :
shell> kill `cat /mysql-data-directory/host_name.pid` 쉘> 죽이기`고양이 / mysql-data-directory/host_name.pid`
Note the use of backticks rather than forward quotes with the cat command; these cause the output of cat to be substituted into the kill command. 인용 부호의 사용을 참고로 고양이가 명령을 전달보다는 backticks; 이러한 원인이 출력은 고양이를 죽이는 명령으로 대체합니다.
- Create a text file and place the following command within it on a single line: 텍스트 파일을 만듭니다 시간과 장소에 다음과 같은 명령을 하나의 라인 :
SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(’MyNewPassword’); 비밀 번호 설정 '루트'@ '로컬'= 비밀 번호 ( 'mynewpassword');
Save the file with any name. 임의의 이름에서 파일을 저장합니다. For this example the file will be ~/mysql-init. 이 예제 파일을 ~ / mysql - init합니다.
- Restart the MySQL server with the special –init-file=~/mysql-init option: 를 다시 시작합니다을 반환한다 특별 - init - 파일 = ~ / mysql - init 옵션 :
shell> mysqld_safe –init-file=~/mysql-init & 쉘> mysqld_safe - init - 파일 = ~ / mysql - init &
The contents of the init-file are executed at server startup, changing the root password. init - 파일의 내용을 서버가 실행을 시작, 루트 암호를 변경합니다. After the server has started successfully you should delete ~/mysql-init. 서버가 성공적으로 시작 후 삭제해야합니다 ~ / mysql - init합니다.
- Connect to MySQL server by using the new password. 새 비밀 번호를 사용하여 연결을 반환한다.
Alternatively, on any platform, mysql client can be used to set the new password, althought it’s less secure way of resetting the password (detailed instruction 다른 방법은, 모든 플랫폼, mysql 클라이언트를 사용하여 새 비밀 번호를 설정합니다, 그러나 이것을 재설정 방법을 덜 안전한 비밀 번호 (세부 지침 here 여기에 ): ) :
- Stop mysqld and restart it with the –skip-grant-tables –user=root options (Windows users omit the –user=root portion). 그것을 중지하고 다시 시작 mysqld - 생략 - 그랜트 - 테이블 - 사용자 = 루트 옵션 (윈도우 유저 - 사용자 = 루트 부분을 생략합니다).
- Connect to the mysqld server with this command: 이 명령에 연결하여 서버와 mysqld :
shell> mysql -u root 쉘> mysql - u 루트
- Issue the following statements in the mysql client: 문제를 다음과 같은 문장을 mysql 클라이언트 :
mysql> UPDATE mysql.user SET Password=PASSWORD(’newpwd’) mysql> 업데이 트를 mysql.user = 비밀 번호를 비밀 번호 설정 ( 'newpwd')
-> WHERE User=’root’; -> 여기서 사용자 = '루트';
mysql> FLUSH PRIVILEGES; mysql> 플러시 권한을;Replace ‘newpwd’ with the actual root password that you want to use. 대체 'newpwd'를 실제로 사용하려는 루트 비밀 번호를합니다.
- You should be able to connect using the new password. 당신의 새 비밀 번호를 사용하여 연결할 수 있어야합니다.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 중요 사항 : 이것은 기계 번역 페이지는 "있는 그대로"제공하지 않고 보증합니다. Machine translation may be difficult to understand. 기계 번역을 이해하기 어려울 수있습니다. Please refer to 를 참조하시기 바랍니다 original English article 기존 영어 자료 whenever possible. 언제 수있습니다.
Share and contribute or get technical support and help at 를 공유하고 기술 지원 및 도움을 공헌하지 않는다면 My Digital Life Forums 내 디지털 라이프 공개 토론 . 합니다.
Related Articles 관련 기사
- Change and Reset MySQL root Password mysql 루트 암호를 변경 및 재설정
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 3 freebsd 6.0과 아파치 웹 서버에 설치하는 2.2, mysql 5.0과 php 5 - 제 3
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4 windows XP 용 웹 서버에 설치와 apache2, php5, mysql4 - 4 부
- Check and Optimize MySQL Database Automatically with Crontab/Cron mysql 데이터베이스를 확인하고 자동으로 최적화하는 crontab / cron
- Using phpMyAdmin for Effective MySQL Management in Windows XP phpmyadmin를 사용하여 windows XP 용의 효율적인 관리를 mysql
- Fix for Munin MySQL Monitoring Plugin Graph Not Showing or Blank 그래프가 표시되지 않는 플러그 접속 mysql 모니터링에 대한 수정 프로그램 또는 공백 munin
- How to Reset WordPress Password to Recover Forgotten Secret 비밀 번호를 잊어버린 비밀을 복구하는 wordpress를 다시 설정하는 방법
- How to Reset AdSense Password Not Associated with Google Account 애드 센스 비밀 번호를 재설정하는 방법을 구글 계정과 관련되지 않았습니다
- Disable Direct Root Login and User Access via SSH to Server 쉿를 통해 사용자 액세스 권한을 해제 직접적으로 루트 서버에 로그인하고
- Install phpBB 2 in Windows XP running on Apache 2, PHP 5 and MySQL 4 windows XP 용 phpbb 2를 설치에서 실행되는 아파치 2> = 4.0.0, mysql 4
June 6th, 2006 18:12 2006년 6월 6일 18시 12분
[...] Other then the ways specified here to reset and change the root password for mySQL database in the case that the password is forgotten or lost, the following instructions explain in details the alternative way at the last part of the guide, where no additional file needs to be created: [...] [...] 다른 방법으로 다음의 루트 지정 및 변경에 대한 암호를 재설 정할 여기에 mysql 데이터베이스의 비밀 번호를 잊어버린이나 분실의 경우는 다음과 같은 지침을 설명하고 다른 방법을 자세히 설명합니다 마지막 부분의 가이드, 어디 추가 파일을 만들 필요가없습니다 : [...]
October 8th, 2007 03:47 2007년 10월 8일 03:47
You should add –verbose –console to the command in step 5. - 자세한 정보 - 콘솔을 추가해야 5 단계에서의 명령합니다. I got a error because of a copy and paste issue that include a quote of the wrong type but there’s no error feedback without the –console. 이 있어요 오류로 인해 문제를 복사 및 붙여넣기의 잘못된 유형에 대한 견적을 포함하지만 그것도 오류가 의견 - 콘솔을하지 않고있습니다. Also, the -console to stop the server with CTRL-C under windows, not sure about linux. 또한, 서버와 ctrl - 콘솔을 중지합니다 - c 윈도우가 아닌 리눅스 확신합니다.
-Mike - 마이크
April 23rd, 2008 23:38 2008년 4월 23일 23시 38분
This isn’t correct. 이것은 올바르지 않습니다. The syntax should be “–init” not “-init”. 의 구문해야 "- init"안 "- init".
April 23rd, 2008 23:39 2008년 4월 23일 23시 39분
Ah and now that I’ve posted I see the problem. 아 그리고 이제는 나는이 보이 네요 문제를 게시했습니다. This site is disallowing double “-”. 이 사이트는 허용 더블 "-". It’s being escaped or something. 이스케이프라도 우리가합니다.
Well dear reader, just now that “-init” should have TWO dashes (hyphens), not one. 잘 친애하는 지도자가 바로 지금 "- init"는 두 개의 대시 (하이픈), 한.
April 23rd, 2008 23:39 2008년 4월 23일 23시 39분
Gah. 이런합니다. “know” not “now”. "잘 알고,"아니오 "로한다". I’m going for coffee now. 지금 나는 커피를 마시 간다.
April 24th, 2008 10:05 2008년 4월 24일 10:05
Dude, 녀석,
Didn’t see these comments while reading the article, but I figured out the double-hyphen syntax by trial and error. 이 문서 이러한 의견을 읽는 동안 몰랐지만 더블 - 하이픈 구문을 파악해 시행 착오를합니다.
Anyway you saved my Life by putting this documentation on the Net !! 어쨌든이 문서에 놓음으로써 내 생명을 구해 그물! A thousand thanks ! 1000 감사합니다! -Rob - 롭
April 25th, 2008 01:37 2008년 4월 25일 01:37
There is a typo on the mysqld startup script. mysqld에 오타가 시작 스크립트를합니다.
The correct command requires TWO dashes before the parameter setting. 올바른 명령을 매개 변수를 설정하기 전에 두 개의 대시가 필요합니다.
The correct command is (note TWO dashes before skip-grant-tables): 올바른 명령은 (참고 사항 건너뛰기 - 그랜트 - 테이블을하기 전에 두 개의 대시) :
mysqld_safe –skip-grant-tables - 생략 - 그랜트 - 테이블을 mysqld_safe
July 31st, 2008 21:18 2008년 7월 31일 21:18
Procdure to reset root password in MySQL [RedHat & Fedora] 루트 암호를 재설 정할 procdure mysql [레드햇 & 중절모]
====================================================== ================================================== ====
Step-1 단계 - 1
[root@redhat~]#killall mysqld [루트 @ 레드햇 ~] # killall mysqld
[root@redhat~]#/usr/libexec/mysqld –skip-grant-tables –user=root & [루트 @ 레드햇 ~] # / usr / libexec / mysqld - 생략 - 그랜트 - 테이블 - 사용자 = 루트 &
====================================================== ================================================== ====
Step-2 (In MySQL) - 2 단계 (mysql)
[root@redhat~]#mysql [루트 @ 레드햇 ~] # mysql
use mysql; mysql을 사용;
update user set password=password(”newpassowrd”) where user=”root”; 업데이 트를 사용자 설정 비밀 번호를 = 비밀 번호를 ( "newpassowrd") 어디에 사용자 = "루트";
flush privileges; 플러시 권한을;
exit; 출구;
====================================================== ================================================== ====
Step-3 - 3 단계
[root@redhat~]#killall mysqld [루트 @ 레드햇 ~] # killall mysqld
[root@redhat~]#/etc/init.d/mysqld start [루트 @ 레드햇 ~] # / 비고 / init.d / mysqld 시작
There you go 여기요
August 14th, 2008 10:47 2008년 8월 14일 10:47
phpmyadmin
September 9th, 2008 07:34 2008년 9월 9일 07:34
Completely wrong syntax, check the code before posting guy 완전히 틀린 문법, 게시하기 전에 사람의 코드를 확인