Linux
윈도우 Ubuntu 환경에서 MariaDB 설치
circle.j
2023. 7. 14. 17:33
1. 우분투 터미널 접속
(1) MariaDB 서버 설치
$ apt install mariadb-server
(2) MariaDB-client를 설치
$ apt-get install mariadb-client
(3) MariaDB 계정 및 보안 설정
$ sudo mysql_secure_installation
- Switch to unix_socket authentication -> n
- Change the root password? -> n
- Remove anonymous users? -> y
- Disallow root login remotely? -> y
- Remove test database and access to it? -> y
- Reload privilege tables now? -> y
(4) 접속 테스트
$ sudo mysql -u root -p
2. 설치한 mariaDB 버전 확인
$ select version();
3. mariaDB 실행 여부 확인
$ sudo systemctl status mariadb
4. 외부 IP 접속 허용
(1) $ sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf
(2) bind-address 부분을 0.0.0.0 으로 수정
(3) mariaDB 재시작: sudo systemctl restart mysqld
5. 방화벽 3306 접근 허용
$ sudo ufw allow 3306/tcp