Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Windows 10
- plugin
- 줄바꿈 문자
- ssh
- tomcat
- IntelliJ
- grep
- profile
- 네트워크
- lsof
- JavaScript
- netsh
- web.xml
- port
- Eclipse
- xargs
- Source
- VirtualBox
- Windows
- context
- import
- maVen
- Mac
- vscode
- Quartz
- 단축키
- GIT
- bash
- resource
- find
Archives
- Today
- Total
develog
[mariaDB] 외부에서 접속 안될 때 본문
ubuntu 에 mariaDB 설치하기
$ sudo apt install mariadb-server
$ sudo apt install mariadb-client
bind-address 를 0.0.0.0 으로 수정한다
bind-address 를 0.0.0.0 으로 수정한다
## sudo vi /etc/mysql/mariadb.conf.d/50-server.cnf
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#bind-address = 127.0.0.1
bind-address = 0.0.0.0
mariaDB 를 재시작한다
systemctl restart mariadb
root 계정의 host 를 % 로 변경한다
mariaDB 에 접속한다
root@ubuntu01:~# mysql -u root
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 42
Server version: 10.6.16-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
DB 를 mysql 로 변경한다
MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [mysql]>
root 계정의 host 를 확인한다
MariaDB [mysql]> select host, user, password from user;
+-----------+-------------+----------+
| Host | User | Password |
+-----------+-------------+----------+
| localhost | mariadb.sys | |
| localhost | root | invalid |
| localhost | mysql | invalid |
+-----------+-------------+----------+
3 rows in set (0.001 sec)
root 계정의 host 를 % 로 등록한다
MariaDB [mysql]> grant all privileges on *.* to 'root'@'%' identified by '111111';
Query OK, 0 rows affected (0.014 sec)
MariaDB [mysql]>
등록됐는지 확인한다
MariaDB [mysql]> select host, user, password from user;
+-----------+-------------+-------------------------------------------+
| Host | User | Password |
+-----------+-------------+-------------------------------------------+
| localhost | mariadb.sys | |
| localhost | root | invalid |
| localhost | mysql | invalid |
| % | root | *FD571203974BA9AFE270FE62151AE967ECA5E0AA |
+-----------+-------------+-------------------------------------------+
4 rows in set (0.001 sec)
MariaDB [mysql]>
외부에서 DB 접속이 되는지 확인한다
Comments