[MariaDB] root 패스워드를 분실 했을때 처리방법 > 기술자료

본문 바로가기

사이트 내 전체검색

[MariaDB] root 패스워드를 분실 했을때 처리방법 > 기술자료

MySQL [MariaDB] root 패스워드를 분실 했을때 처리방법

페이지 정보


본문

[ CentOS 7 ] root 패스워드를 분실 했을때 처리방법
서비스 정지  ->  mysql 안전모드 실행  ->  패스워드 변경  ->  연결테스트  ->  서비스 재시작


1. 서비스 정지
[root@localhost ~]# systemctl stop mariadb

2. mariadb 안전모드 실행
[root@localhost ~]# sudo /usr/bin/mysqld_safe --skip-grant &
[1] 7845
[root@localhost mysql]# 170801 18:02:09 mysqld_safe Logging to '/var/log/mariadb/mysql-error.log'.
170801 18:02:09 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

[1]+  Done                    sudo /usr/bin/mysqld_safe --skip-grant

3. 패스워드 변경
[root@localhost ~]# mysql -uroot mysql
Mariadb[mysql]> update user set password=password('변경할비밀번호') where user='root';
Mariadb[mysql]> flush privileges;
Mariadb[mysql]> exit;

4. 접속 테스트
[root@localhost ~]# mysql -uroot -p
패스워드 입력 ...

MariaDB[(none)]>

5. 서비스 재시작
[root@localhost ~] systemctl stop mariadb
[root@localhost ~] systemctl start mariadb


관련자료
http://digndig.kr/mysql/793/ 
http://blog.ivps.kr/7


[ CentOS 6.8 ] root 패스워드를 분실 했을때 처리방법

1. 서비스 정지
[root@localhost ~]# cd /var/lib/mysql
[root@localhost ~]# killall mysqld

2. mariadb 안전모드 실행
[root@localhost ~]# /usr/bin/mysqld_safe --skip-grant &
[2] 15278
[root@localhost ~]# 170228 10:15:46 mysqld_safe Logging to '/var/lib/mysql/localhost.err'.
170228 10:15:46 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
mysql    을 입력하고 엔터
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.1.21-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use mysql
Database changed
MariaDB [mysql]> update user set password=password('12345') where user='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3  Changed: 3  Warnings: 0

MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

MariaDB [mysql]> exit
Bye
[root@localhost ~]# 


관련자료
http://egloos.zum.com/kiringun/v/1168215 

댓글목록

등록된 댓글이 없습니다.


Total 2,645건 38 페이지
  • RSS
기술자료 목록
열람
MySQL   25058  2017-02-23 19:28 ~ 2018-01-10 00:00  
1904
Linux   16635  2017-02-23 19:22 ~ 2018-07-08 02:22  
1903
MySQL   48192  2017-02-23 18:31 ~ 2018-01-10 06:13  
1902
Linux   11652  2017-02-22 23:57  
1901
Linux   13347  2017-02-22 23:43 ~ 2019-01-21 06:47  
1900
영카트   13689  2017-02-21 15:53  
1899
JavaScript   16693  2017-02-21 14:10  
1898
JavaScript   42274  2017-02-21 13:23 ~ 2019-09-18 20:55  
1897
그누보드   12809  2017-02-20 19:05  
1896
그누보드   12179  2017-02-20 16:30 ~ 2017-10-10 00:00  
1895
일반   10657  2017-02-18 13:37  
1894
일반   24053  2017-02-18 12:42 ~ 2017-04-19 00:00  
1893
JSP   13301  2017-02-17 23:15  
1892
JSP   11149  2017-02-17 22:59  
1891
JSP   12598  2017-02-17 21:19  
1890
JSP   13202  2017-02-17 21:17  
1889
JSP   14722  2017-02-17 21:02  
1888
MSSQL   13791  2017-02-15 22:27  
1887
JSP   13075  2017-02-15 19:02  
1886
JSP   13390  2017-02-15 12:59  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2025 해피정닷컴. All Rights Reserved.