728x90
반응형

맥북 환경에 디비 서버 구축하고, 그 데이터를 테스트 서버(VM)에서 땡겨올 예정

#homebrew로 설치
~ % brew install mariadb
~ % brew services start mariadb

#homebrew로 실행
~ % brew services start mariadb
==> Successfully started `mariadb` (label: homebrew.mxcl.mariadb)

#실행 서비스 조회
~ % brew services start list
mariadb started s ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist

 

외부 접속 설정


 

# 계정 설정 시 구분 ###################################

내부 접속
CREATE USER 'test'@'localhost' identified by '1234';

외부 접속(모든 IP)
CREATE USER 'test'@'%' identified by '1234';

외부 접속(특정 IP, 특정 대역)
CREATE USER 'test'@'123.123.%' identified by '1234';

################################################

> show databases;                                      // 디비 현황
> CREATE DATABASE songtestdb;           // songtestdb 디비 생성
> USE songtestdb                                       // songtestdb 사용

[계정생성]
MariaDB [songtestdb]> CREATE USER 'song'@'%' identified by '1234';

[이거로도 계정생성]
MariaDB [songtestdb]> GRANT ALL PRIVILEGES ON *.* TO 'song'@'%' IDENTIFIED BY '1234';
MariaDB [songtestdb]> FLUSH PRIVILEGES;
MariaDB [songtestdb]> select user, host from mysql.user;

[계정삭제]
MariaDB [songtestdb]>DELETE FROM mysql.user WHERE host='%' AND user='song';
FLUSH PRIVILEGES;

 

 

 

제목2


ㅁㅁ

ㅁㅁ

ㅁㅁ

 

 

-끝-

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

728x90
반응형

+ Recent posts