반응형
개발 및 설치 환경
- MacOS Sequoia 15.1.1
- MySQL 9.0.1 (Homwbrew 활용한 설치)
- DBeaver 24.2.4
Homebrew로 활용한 MySQL 설치
brew install mysql
brew services start mysql
Homebrew로 설치된 MySQL 확인
mysql --version
MySQL 초기 설정 터미널에서 명령어를 실행하면 MySQL 초기 설정 화면 6단계 나타납니다.
mysql_secure_installation
MySQL 초기 설정 간단 요약 :
- 패스워드 검증(Validate Password)
- 루트 비밀번호: 새 비밀번호 설정 완료
- 익명 사용자 계정(Anonymous Users)
- 원격 루트 로그인(Root Remote Login)
- 테스트 데이터베이스(Test Database)
- 권한 테이블 재로드(Privilege Tables)
Securing the MySQL server deployment.
Connecting to MySQL using a blank password.
VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?
Press y|Y for Yes, any other key for No: n
Please set the password for root here.
New password:
Re-enter new password:
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
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
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) : n
... skipping.
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
Success.
All done!
Homebrew로 설치된 MySQL 🔛 DBeaver 연동
DBeaver 설치 및 실행
왼쪽 상단 메뉴 - 새 데이터베이스 연결 - MySQL 실행
MySQL 설정한 비밀번호를 입력한 후 Test Connection 누릅니다.
비밀번호 입력 후 Test Connection 누르면 Public Key Retrieval is not allowed 오류가 발생할 수 있습니다.
Driver Properties 환경에서 아래 내용을 수정합니다.
[변경 전]
allowPublicKeyRetrieval false (X)
[변경 후]
allowPublicKeyRetrieval true (O)
MySQL DBeaver 연결 성공
Homebrew로 설치된 MySQL 삭제
MySQL이 실행 중이면 먼저 중지합니다.
brew services list
brew services stop mysql
MySQL 삭제
brew uninstall mysql
MySQL의 잔여 데이터 및 설정 파일 삭제
MySQL 관련 데이터 및 설정 파일이 시스템에 남아 있을 수 있습니다.
rm -rf /usr/local/var/mysql
rm -rf /usr/local/etc/my.cnf
MySQL 삭제 후 확인
삭제가 제대로 이루어졌는지 MySQL 버전 확인합니다.
이 명령어가 "command not found"를 반환하면 삭제가 완료된 것입니다.
mysql --version
Homebrew로 설치된 MySQL 패키지 확인
MySQL이 목록에 없으면 삭제가 완료된 것입니다.<사진 참조>
brew list | grep mysql
반응형
댓글