Mysql 5.7 루트 비밀번호 잊 고 mysql 5.7 루트 비밀번호 수정 방법
[[email protected] ~]# service mysql stop
운행 하 다.
[[email protected] ~]# mysqld_safe --skip-grant-tables &
안전 을 위해 원 격 연결 을 금지 할 수 있 습 니 다:
[[email protected] ~]# mysqld_safe --skip-grant-tables --skip-networking &
mysql 로 server 연결 하기:
[[email protected] ~]# mysql -p
비밀번호 변경:
mysql> update mysql.user set authentication_string=password('123qwe') where user='root' and Host = 'localhost';
*특히 주의해 야 할 점 은 새 my sql 데이터베이스 에 있 는 user 표 에 Password 필드 가 없습니다.암호 화 된 사용자 암 호 를 authentication 에 저장 합 니 다.string 필드
mysql> flush privileges;
mysql> quit;
수정 완료.다시 시작
[root@localhost ~]# service mysql restart
그리고 mysql 로 연결 할 수 있어 요.하지만 이 때 는 기능 이 불완전 한 것 같 습 니 다.alter user...
mysql> alter user 'root'@'localhost' identified by '123';
이렇게 해도 된다.
mysql> set password for 'root'@'localhost'=password('123');
my sql 5.7 root 비밀번호 수정 에 중점 을 두 겠 습 니 다.MySQL 관리자 비밀번호 설정 또는 변경:
공식 설명 5.6 이후 버 전 에 따 르 면 첫 번 째 시작 시 루트 디 렉 터 리 에서 무 작위 비밀 번 호 를 생산 합 니 다.파일 이름.my sqlsecret。
[root@bright ~]# cat /root/.mysql_secret
# Password set for user 'root@localhost' at 2015-03-27 23:12:10
:Jj+FTiqvyrF
[root@bright ~]# cd /usr/local/mysql/bin/
[root@bright bin]# ./mysqladmin -u root -h localhost password '123456' -p
비밀번호 입력:\#이 줄 에.mysql 입력비밀 속 두 번 째 줄 내용
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
공식 적 인 방식 으로 필 자 는 사용 여부-skip-grant-tables 시작 my sql 에 실 패 했 습 니 다.여러분 은 테스트 할 수 있 습 니 다.
shell>mysql -uroot -p'password' #password .mysql_secret
mysql>SET PASSWORD = PASSWORD('newpasswd');
이전 버 전,설치 후 ROOT 에 비밀번호 가 없습니다.다음 을 누 르 십시오.
방법 1:
shell>service mysqld stop # mysql
shell>mysqld_safe --skip-grant-tables & # grant-tables mysql
shell>mysql -uroot -p # , 。
mysql>use mysql;
mysql>update user set password=PASSWORD("123456")where user="root"; # newpassord
mysql>flush privileges; #
mysql>quit #
방법 2:
shell>service mysqld stop # mysql
shell>mysqld_safe --skip-grant-tables & # grant-tables mysql
shell>mysql -uroot -p # , 。
mysql > set password for root@localhost = password('mysqlroot');
방법 3:
shell>/path/mysqladmin -u UserName -h Host password 'new_password' -p
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
MySQL에서 JSON 인덱싱 - aarondfrancis사람들은 종종 MySQL로 JSON을 인덱싱할 수 없다고 말하지만 완전히 정확하지는 않습니다. MySQL로 JSON 열을 인덱싱하는 것은 완전히 가능합니다! 사람들은 종종 MySQL로 JSON을 인덱싱할 수 없다고 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.