mysql + dbeaver 연결
2020. 7. 22. 10:40ㆍ재활용용
mysql
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
mysql> create database hr default CHARACTER SET UTF8;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| hr |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
mysql> use hr
Database changed
mysql> CREATE USER 'mymy'@'%' IDENTIFIED BY 'my-password';
Query OK, 0 rows affected (0.00 sec)
mysql> GRANT ALL PRIVILEGES ON hr.* TO 'mymy'@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> grant select,insert,update,delete on aidb.* to 'mymy'@'%';
Query OK, 0 rows affected (0.00 sec) # 변경사항 적용하기 flush privileges; mysql> exit Bye
root@8da72ab0b59d:/# mysql -u mymy -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.31 MySQL Community Server (GPL)
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use hr
Database changed
|
cs |
밑의 명령대로 하면 잘 안된다 . 안되는 예시
CREATE DATABASE testdb CHARACTER SET utf8; CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'testpassword'; GRANT ALL PRIVILEGES ON testdb.* TO 'testuser'@'localhost';
Access denied for user 'testuser'@' "10.0.2.2'"
이 꼴 나면서 연결을 거부한다. 요망한 것.... 그래서 'user'@'%' 표시 해줘서 모든 ip에 대해 연결해줘야한다.
https://stackoverflow.com/questions/31289831/access-database-outside-of-vagrant-box-as-user
2. virtual box port forwarding 설정
virtualbox -> 설정 -> 네트워크 -> 포트포워딩
3. dbeaver 설정
database navigator -> right click -> create -> connection
'재활용용' 카테고리의 다른 글
scrollLockPusher - mouseJiggler 대용 화면보호방지기(POWERSHELL) (2) | 2022.10.18 |
---|---|
[javascript] code snippet 2 (0) | 2021.10.04 |
[Javascript] 즐겨 쓰는 code snippet (2) | 2021.09.28 |
Dockerfile 이용한 centos+mongodb 설치, centos+mariadb 설치 (0) | 2020.07.17 |
vs code python build 설정(tasks.json) (0) | 2020.07.12 |