[리눅스] MySQL 5.7 보안설정

간단한 명령어 하나로 보안 설정 및 MySQL root 암호를 변경하는 것을 진행하겠습니다.

MySQL 5.7 버전의 경우 /var/log/mysqld.log 파일 내에 임시 비밀번호가 저장됩니다.

다음의 명령어로 간단하게 찾으실 수 있습니다.

cat /var/log/mysqld.log | grep "temporary password"
[root@dothome-world ~]# cat /var/log/mysqld.log | grep "temporary password" 019-07-05T08:40:24.840936Z 1 [Note] A temporary password is generated for root@localhost: pyeF6fK7Du!/

위에서 나온 비밀번호(pyeF6fK7Du!/)를 복사하시거나 메모하신 후 다음 명령어로 보안 설정을 진행하겠습니다.

다음의 주석들을 확인해 보시면서 진행하시면 됩니다.

mysql_secure_installation
[root@dothome-world ~]# mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: # 임시 비밀번호 입력(pyeF6fK7Du!/) The existing password for the user account root has expired. Please set a new password. New password: # 사용 원하시는 MySQL root 암호 입력 Re-enter new password: # 재 입력 The 'validate_password' plugin is installed on the server. The subsequent steps will run with the existing configuration of the plugin. Using existing password for root. Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : No # 이미 변경해서 스킵 ... skipping. By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? (Press y|Y for Yes, any other key for No) : y # anonymous 계정 삭제 Success. Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y # MySQL 원격 접속 비허용 Success. By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y # TEST DB 삭제 - Dropping test database... Success. - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y # grant 권한 재설정 Success. All done!
0
0
이 글을 페이스북으로 퍼가기 이 글을 트위터로 퍼가기 이 글을 카카오스토리로 퍼가기 이 글을 밴드로 퍼가기
captcha
자동등록방지 숫자입력

웹개발

번호 제목 글쓴이 날짜 조회수
22 [리눅스] Apache Document Root 권한설정 최고관리자 09-04 1,498
21 [리눅스] CentOS Version 확인하기 최고관리자 09-04 1,340
20 [리눅스] MySQL 최초 접속 및 설정 최고관리자 09-03 1,633
19 [리눅스] MySQL 5.7 보안설정 최고관리자 09-03 1,433
18 [리눅스] RDate로 시간 동기화 하기. 최고관리자 09-03 1,358
17 [리눅스] 기본설치 (Apache , PHP , MySql) 최고관리자 09-03 1,911
16 [공부] 프로그래밍 공부 사이트 최고관리자 09-01 1,292
15 [기능] Mobile 메뉴 최고관리자 09-01 1,265
14 [기능] Mega Menu 최고관리자 09-01 1,309
13 [기능] 상단에서 메뉴높이가 높고 아래로 스크롤하면 메뉴높이가 줄어듦 최고관리자 09-01 1,318
12 [기능] 상단에 메뉴가 보이다가 아래로 스크롤하면 메뉴가 사라지고 상단으로 가면 메뉴가 보임. 최고관리자 09-01 1,232
11 [기능] 메뉴가 안 보이다가 아래로 스크롤하면 메뉴가 생김 최고관리자 09-01 1,338
10 [기능] Icon으로 구성된 수직/수평 메뉴 최고관리자 09-01 1,182
9 [JS] 자바스크립트 {...} [...] 문법 (비구조화 할당/구조분해 할당) 최고관리자 09-01 1,195
8 [기능] 상단의 높이가 큰 메뉴상태에서 아래로 스크롤하면 상단에 높이가 낮은 메뉴가 고정됨 최고관리자 09-01 1,195
7 [Font] Naversoftware 폰트 리스트 최고관리자 09-01 1,273
6 [Web Font] 직접입력해서 폰트를 확인할 수 있는 사이트 최고관리자 09-01 1,262
5 [CSS - font] unicode-range 최고관리자 08-31 1,497
4 [UI 참고] Oven - 회원가입 최고관리자 08-31 1,227
3 타자기체 - 가로 세로 비율이 고정되어 있는 글꼴로 표현 최고관리자 08-08 1,310