Search

3. MariaDB 설치

MariaDB란?

mySql에서 파생된 MariaDB
mySql이 오라클에 인수될때 mySql 개발자들이 나와서 MariaDB를 만듦. 그래서 거의 똑같다.

MariaDB 설치

windows OS 설치

들어가면
최근 버전은 알파버전이라 다운받지않고 한단계 아래버전으로 받아주자.

1.1 관리자 아이디 버전 설정

파일 실행해서 진행 하다보면 root 패스워드를 정할 수 있다.
입력해두고 따로 메모해서 정리해두자. 아직 체크할게 남았다.
원격으로 root에 접속하게 할거냐 물어보는데 체크해주고 (외부에서 들어올수있게 체크)
UTF8도 체크해주자
포트는 3306이 디폴트.
mySql 설치가 되어있다면 기존 포트가 충돌나기 때문에 3307로 포트를 바꿔주면 된다.
검색창에 h치면 이미지에 이렇게 뜬다.
실행
신규 누르고 세션명 지정. root 패스워드 및 포트 입력해주고 저장 후 열기

1.2 사용자 생성 및 DB 생성 및 권한 설정

입력해서 한줄씩 실행해주자 . 해당 줄에 클릭 해두고 ctrl + enter 치면 실행된다.
-- cos 라는 사용자를 만들거고 비밀번호는 cos1234 create user 'cos'@'%' identified by 'cos1234'; -- cos에게 모든 테이블의 접근 권한과 생성,삭제 및 모든 권한을 준다. GRANT ALL PRIVILEGES ON *.* TO 'cos'@'%'; -- database를 photogram으로 만든다. create database photogram;
SQL
복사
EaszUp-Springboot-Photogram-Start
codingspecialist
^ 참고 사이트
다시 새 세션만들기로 가서 세션명을 cos-photogram 으로 정하고
사용자명이랑 비밀번호를 치고 저장 후 열기.
기존에 연결했던 photogram은 연결해제를 해줘도 된다.

MacOS 설치

homebrew 통해 설치.
homebrew를 설치 안했다면
MacOS homebrew(홈브류) 설치
<head> <style> @media (min-width: 1400px) { .notion-scroller { position: static !important; } .notion-scroller-options { display: none; } .notion-frame { position: relative !important; } .notion-table_of_contents-block { position: absolute !important; max-width: 250px; height: calc(100% - 660px); top: 660px !important; transform: translateX(calc((var(--page-max-width) + 250px - 96px) / 2)); } .notion-table_of_contents-block div { background-image: none !important; white-space: normal !important; } .notion-table_of_contents-block > div { position: sticky !important; padding-left: 10px; top: 60px; border-left: 3px solid rgba(256, 0, 0, 0.1); } .css-1fssah9{ position: absolute !important; max-width: 250px; height: calc(100% - 660px); top: 660px !important; transform: translateX(-18rem); } .css-1fssah9 div { background-image: none !important; white-space: normal !important; } .css-1fssah9 > div { position: sticky !important; padding-left: 10px; top: 60px; } } @media (max-width: 1400px) { .notion-table_of_contents-block { display: none; } .css-1fssah9 { display: none; } } </style> <script> let ele = document.querySelector(".notion-page-content") let headers = ele.querySelectorAll("h2, h3, h4") let content = document.querySelector(".notion-table_of_contents-block > div"); function useIndex() { let index = 0; return function (newIndex) { if (newIndex !== undefined) index = newIndex; return index; }; } let indexContext = useIndex(); let callback = (entries, observer) => { if (!headers && !content) return; headers.forEach((header, index) => { if (header === entries[0].target && entries[0].isIntersecting) { indexContext(index); } else { content.childNodes[index].style.color = ""; } }); content.childNodes[indexContext()].style.color = "red"; } let observer = new IntersectionObserver(callback, { threshold: [1] // If 50% of the element is in the screen, can count it }); headers.forEach(d => { observer.observe(d); }) </script> </head>

1.1 관리자 아이디 버전 설정

터미널 켜서 1번 ~ 4번까지 해주자
1. 설치 brew install mariadb 2. 버전 확인 mariadb -V 3. 마리아db 서버 실행 brew services start mariadb 4. root 비밀번호 생성 및 보안 설정을 변경 > 비번 설정해주고 y로 진행 sudo mariadb-secure-installation ------------------------------------------------------------------------------ 그 외 *. 마리아db 서버 중지 brew services stop mariadb *. 마리아db 서버 재시작 brew services restart mariadb *. brew 실행 목록 확인 brew services list *root 계정 비밀번호 1234로 설정 ALTER USER 'root'@'localhost' IDENTIFIED BY '1234'; *변경된 부분을 데이터베이스에도 적용 flush privileges;
Bash
복사
DBeaver 설치
brew install --cask dbeaver-community
Bash
복사
마리아db로 진행
root 패스워드 등록 후 test connection으로 연결되는거 보고 생성.

1.2 사용자 생성 및 DB 생성 및 권한 설정

밑에는 윈도우랑 똑같이 진행해주면된다.
입력해서 한줄씩 실행해주자 . ctrl + enter 치면 실행된다.
-- cos 라는 사용자를 만들거고 비밀번호는 cos1234 create user 'cos'@'%' identified by 'cos1234'; -- cos에게 모든 테이블의 접근 권한과 생성,삭제 및 모든 권한을 준다. GRANT ALL PRIVILEGES ON *.* TO 'cos'@'%'; -- database를 photogram으로 만든다. create database photogram;
SQL
복사
^ 참고 사이트
다시 새 세션 만들어줘서
cos유저로 진행 하고 기존 photogram 은 연결해제해주자.

*참고