개발 => 복습 후 재정리 대기/Node.js
[Node.js] AWS - MySQL 설치
1. MySQL 설치 + root 계정 설정
sudo apt-get update
sudo apt install mysql-server
sudo mysql -uroot
mysql> use mysql
mysql> SELECT User, Host, plugin FROM mysql.user;
+------------------+-----------+-----------------------+
| User | Host | plugin |
+------------------+-----------+-----------------------+
| debian-sys-maint | localhost | caching_sha2_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session | localhost | caching_sha2_password |
| mysql.sys | localhost | caching_sha2_password |
| root | localhost | auth_socket |
+------------------+-----------+-----------------------+
root 계정이 auth_socket으로 되어있으면 password 없이 sudo권한만으로 접속이 가능!
mysql> UPDATE user SET plugin='caching_sha2_password' WHERE User='root';
mysql> select user, host, plugin from user;
+------------------+-----------+-----------------------+
| User | Host | plugin |
+------------------+-----------+-----------------------+
| debian-sys-maint | localhost | caching_sha2_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session | localhost | caching_sha2_password |
| mysql.sys | localhost | caching_sha2_password |
| root | localhost | caching_sha2_password |
+------------------+-----------+-----------------------+
mysql> alter user 'root'@'localhost' identified with mysql_native_password by '1234';
mysql> flush privileges;
mysql> exit
$ mysql -uroot -p
Enter password:
패스워드 재입력시 잘 된다면 완료!
2. 새 계정 생성
mysql> create user 'kangaroo'@'%' identified by 'password';
// % 는? ssh 접속 외에도 가능하게 하여 워크벤치로 접근 가능하게!
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT USER, HOST FROM mysql.user;
+------------------+-----------+
| USER | HOST |
+------------------+-----------+
| kangaroo | % |
| debian-sys-maint | localhost |
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+------------------+-----------+
6 rows in set (0.00 sec)
mysql> grant all privileges on *.* to 'kangaroo'@'%';
mysql> flush privileges;
'개발 => 복습 후 재정리 대기 > Node.js' 카테고리의 다른 글
[Node.js] express HTTPS 설정 ( cerbot ) (3) | 2022.01.05 |
---|---|
[Jenkins] Node.js - Jenkins - Slack 연동 (0) | 2021.08.16 |
[node-schedule][cron] 특정 시간에 동작하기 (0) | 2021.08.09 |
작성중... [Node.js] Swagger 설치, 적용 (0) | 2021.07.16 |
[Node.js][Express] 기본 틀 공부중 (5) | 2021.05.25 |
댓글