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

웹개발

번호 제목 글쓴이 날짜 조회수
82 [PHP] empty vs is_null vs is_set 비교 최고관리자 09-11 1,265
81 [Font] Every Font Awesome 4.7.0 Icon, CSS Class, & Unicode 최고관리자 08-19 1,302
80 [PHP] 문자열을 구분자로 구분하여 배열로 만들때 whitespace trim시키기 최고관리자 07-29 1,273
79 [PHP] $_SERVER['SERVER_NAME'] vs $_SERVER['HTTP_HOST'] 최고관리자 07-23 1,601
78 [css] Layout을 제대로 하고 싶다면 Flex 와 Grid를 배워보자 최고관리자 07-20 1,702
77 [PHP] define 중복으로 인한 Internal Server Error 500 최고관리자 07-16 1,217
76 [MySQL] Procedure & View 확인 최고관리자 05-25 1,218
75 [JavaScript] JQuery를 이용한 Drag Drop 리스트 순서변경 최고관리자 05-21 2,946
74 [JavaScript] defer 와 async 최고관리자 05-14 1,285
73 [JavaScript] 홈페이지에 날개를 달자 -2 최고관리자 04-26 1,232
72 [HTML] URL 사용 규칙 최고관리자 03-30 1,284
71 [JS] 자바스크립트 쿠키 클래스 최고관리자 03-19 1,311
70 [MySql] mysql error 메세지 모음 최고관리자 03-11 2,988
69 [PHP] TCP Socket Server +2 최고관리자 03-05 3,137
68 [JS] 문자열로 전송된 함수명을 실행하는 방법 최고관리자 02-26 1,696
67 [Javascript] 홈페이지에 날개를 달자 - Animation & Scrolll 효과 Plugin 최고관리자 02-21 1,245
66 [Form] Submit 버턴 만들어 입력데이타 검사하고 Submit 하기. 최고관리자 01-13 1,259
65 [MySQL] Join 걸어서 Update하기 최고관리자 01-07 1,375
64 [Docker] MedDream DICOM Viewer for Orthanc PACS server 최고관리자 01-05 1,861
63 [Docker] 도커 도메인 여러개 사용하기 (Docker multi Domain) (웹서버 여러개) 최고관리자 01-05 5,988