[MariaDB] root 패스워드를 분실 했을때 처리방법 > 기술자료 | 해피정닷컴

[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 111건 1 페이지
  • RSS
기술자료 목록
111
MySQL   1515  2024-03-29 14:14 ~ 2024-03-29 14:14  
110
MySQL   1806  2024-01-08 17:37 ~ 2024-03-14 16:00  
109
MySQL   5119  2023-04-25 11:36 ~ 2023-04-25 11:37  
108
MySQL   3420  2023-01-30 12:11 ~ 2023-01-30 12:23  
107
MySQL   4454  2022-12-28 21:09 ~ 2022-12-29 06:32  
106
MySQL   3721  2022-12-02 15:40 ~ 2022-12-02 15:41  
105
MySQL   6571  2022-11-22 07:37  
104
MySQL   3340  2022-11-22 07:34 ~ 2022-12-02 12:14  
103
MySQL   3359  2022-11-21 12:10 ~ 2022-11-21 12:18  
102
MySQL   3518  2022-11-16 19:05 ~ 2023-03-03 17:04  
101
MySQL   3158  2022-10-31 16:21 ~ 2022-11-01 09:51  
100
MySQL   3330  2022-10-12 17:39  
99
MySQL   4878  2022-09-29 00:24 ~ 2022-09-29 00:25  
98
MySQL   8397  2022-07-29 19:40 ~ 2022-07-29 19:49  
97
MySQL   5710  2021-12-08 19:53  
96
MySQL   6198  2021-12-08 18:43 ~ 2021-12-08 19:43  
95
MySQL   5003  2021-12-05 00:09 ~ 2021-12-08 19:42  
94
MySQL   5284  2021-12-02 08:36 ~ 2021-12-02 14:57  
93
MySQL   7689  2021-11-24 00:17 ~ 2021-11-24 00:22  
92
MySQL   4442  2021-11-08 16:13 ~ 2021-11-08 17:29  

검색

해피정닷컴 정보

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

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