Team1-TU-tech / semi_final

0 stars 0 forks source link

환경변수 설정 오류 #4

Open hamsunwoo opened 1 week ago

hamsunwoo commented 1 week ago
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/seon-u/code/semi_final/.venv/lib/python3.11/site-packages/pymysql/connections.py", line 361, in __init__
    self.connect()
  File "/Users/seon-u/code/semi_final/.venv/lib/python3.11/site-packages/pymysql/connections.py", line 669, in connect
    self._request_authentication()
  File "/Users/seon-u/code/semi_final/.venv/lib/python3.11/site-packages/pymysql/connections.py", line 957, in _request_authentication
    auth_packet = self._read_packet()
                  ^^^^^^^^^^^^^^^^^^^
  File "/Users/seon-u/code/semi_final/.venv/lib/python3.11/site-packages/pymysql/connections.py", line 775, in _read_packet
    packet.raise_for_error()
  File "/Users/seon-u/code/semi_final/.venv/lib/python3.11/site-packages/pymysql/protocol.py", line 219, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/Users/seon-u/code/semi_final/.venv/lib/python3.11/site-packages/pymysql/err.py", line 150, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1044, "Access denied for user 'tut'@'%' to database 'ticket2'")

DB연결 오류가 났는데, DB연결시 'DB' 라는 환경변수에 다른값이 들어가 있었음.

해결방법

unset <환경변수이름>

환경변수를 초기화하였더니 오류 해결