[Linux] 초기세팅 | wsl2에 mysql 설정하기

JUNG정·2024년 12월 10일

개발서버 구축

목록 보기
4/6
root@DESKTOP-GDPLMAE:~/tk_world/tk_world_server# sudo systemctl status mysql
Unit mysql.service could not be found.

mysql 설치

sudo apt update
sudo apt install mysql-server

우리가 사용하는건 ams RDS db를 연결하는거라 mysql client로 다시 설치

sudo apt install mysql-client

연결시도

mysql -h <db연결url> -P 3306 -u <username> -p

연결 완료

root@DESKTOP-GDPLMAE:~# mysql -h <db연결url> -P 3306 -u <username> -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 101223
Server version: 8.0.33 Source distribution

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

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 [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| dbname1            |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| dbname2            |
+--------------------+
6 rows in set (0.005 sec)

.env파일이 없으면 db와 연결이 안되니 파일 요청하기

초기세팅 | git .env파일 push 안되게 해야함

profile
기록하는 습관

0개의 댓글