[리눅스] 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
자동등록방지 숫자입력

웹개발

번호 제목 글쓴이 날짜 조회수
62 [Linux] CentOS postfix 메일서버 설치 및 설정(sendmail 설정) 최고관리자 12-23 1,489
61 [Ubuntu] 인터넷 연결이 안될 때 최고관리자 12-07 1,296
60 [Apache SSL] Ubuntu 인증서(전자서명) 최고관리자 11-24 1,408
59 [Ubuntu] ssl 임시 인증서 준비 및 발급받기 최고관리자 11-23 1,792
58 [Ubuntu] apache2 환경설정 생성기 최고관리자 11-23 3,013
57 [Ubuntu] apache2 설치 최고관리자 11-23 1,312
56 [vi 편집기] 단축키 최고관리자 11-23 1,241
55 [유용한 블로그] ^^.^^ 최고관리자 11-19 1,248
54 [JS] TimelineJS - 시간의 흐름을 네비게이션화 최고관리자 11-19 1,316
53 [JS] 스크롤을 감지하여 사이트의 헤더를 보이거나 숨기기 최고관리자 11-19 1,452
52 [Linux] NAS Mount 최고관리자 11-12 1,266
51 [React] React활용 최고관리자 11-10 1,304
50 [PHP] exec 실행에 대한 응답코드 최고관리자 11-02 1,655
49 [Linux] Shell Script 최고관리자 10-26 1,561
48 [폰트] 폰트 찾기 사이트 최고관리자 10-21 1,366
47 [통신] Socket packet test Program 최고관리자 10-20 1,849
46 [통신] 맥용 Socket Test Program 최고관리자 10-20 1,634
45 [통신] Mac에서 TCP Socket통신 테스트 하기 최고관리자 10-20 2,910
44 [NginX] 504 Gateway Time-out 에러와 해결방법 +1 최고관리자 10-16 24,584
43 [NginX] 설정 최고관리자 10-13 1,579