2012-05-29 3 views
1

가능한 중복 :
How do I change the password of the root user in MySQL?서버에 대한 루트 액세스 권한으로 어떻게 mysql 루트 암호를 변경하겠습니까?

은 내가 EC2 인스턴스에 대한 루트 액세스 권한이 있지만, 나는 MySQL의 루트 암호는 내가 필요로하는 무엇인지 모른다. 1) 이것을 어떻게 찾을 수 있습니까? 또는 2) mysql을 다시 설치하고 자신에게 루트 암호를 제공 하시겠습니까?

+0

이것은 dba에 속합니다. –

+0

@ DanielA. 서버 결함입니까? –

+0

도 dba 사이트가 아닙니다. –

답변

1
$ sudo service mysql stop 
$ /usr/bin/mysqld_safe --skip-grant-tables & 
mysql -h localhost 
> use mysql 
> update user set password = password('') where user = 'root' and host='localhost'; 
> quit 
$ sudo service mysql start 
$ mysql -u root 
Welcome to the MySQL monitor. Commands end with ; or \g. 
관련 문제