[Trouble Shooting] Cannot Connect to Database Server

LeeSeungEun·2023년 7월 19일
0

Trouble shooting

목록 보기
6/9

1. 에러

  • mysql workbench 실행 중 아래와 같은 에러 메시지 확인

2. 해결

  • hostname을 localhost로 변경 -> 실패
  • 포트번호 변경 -> 시도하다가 방법을 모르겠어서 실패
    • mariadb와 mysql 동시에 사용 시, 포트를 다르게 지정 해줘야한다.
    • mariadb 포트번호 확인
(base) kim-eunchae@gim-eunchaeui-MacBookAir ~ % mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 10.11.3-MariaDB Homebrew

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)]> show global variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port          | 3306  |
+---------------+-------+
1 row in set (0.005 sec)
(base) kim-eunchae@gim-eunchaeui-MacBookAir ~ % cd /usr/local/mysql/bin
(base) kim-eunchae@gim-eunchaeui-MacBookAir bin % ./mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.5.5-10.11.3-MariaDB Homebrew

Copyright (c) 2000, 2022, 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> show global variables like 'port';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port          | 3306  |
+---------------+-------+
1 row in set (0.01 sec)
  • 마리아디비 삭제
* mariadb 서비스 중지
brew services stop mariadb

* mariadb 삭제
brew unlink mariadb
brew remove mariadb
brew uninstall mariadb
brew cleanup

https://singohaja.com/29

1개의 댓글

comment-user-thumbnail
2023년 7월 19일

감사합니다, 이 글이 많은 도움이 되었습니다.

답글 달기