문제 내용: brew install 후 mysql 구동하려 했으나, ERROR 2002 출력 되면서 시작되지 않음
해결 방법: brew services start mysql / mysql -uroot 차례로 입력하여 구동 후 직접 접속
Homebrew로
brew install mysql
mysql 설치 후, mysql 구동을 해보려고 하니
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
이라는 커맨드가 뜨면서 접속이 되지 않았다.
brew 상에 설치된 mysql이 구동되지 않아 명령어를 인식하지 못한 것으로,
brew services start mysql
으로 homebrew 에 설치된 mysql을 구동하고
mysql -uroot
위의 커맨드로 -uroot (user root의 줄임말) 로서 mysql에 접속되었다.
이제 유저 설정, DB 생성 등의 기능을 활용할 수 있다!
p.s.: brew services로 start 한 postgresql, mysql은 이후 따로 종료하지 않는 한 접속 되어 있는 상태가 유지 되니
종료하거나 재부팅하려면 별도로 설정이 필요함에 유의한다.
출처
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
I installed MySQL on Mac OS X Mountain Lion with homebrew install mysql, but when I tried mysql -u root I got the following error: ERROR 2002 (HY000): Can't connect to local MySQL server through
stackoverflow.com
ERROR 2002 (HY000): socket '/tmp/mysql.sock' (2) 해결하려고 brew services start mysql 함
http://meonggae.blogspot.com/2017/03/db-mac-mysql-1-error-2002-hy000-cant.html [db] mac에서 mysql환경설정 셋팅하기 1편 - 설치 및 접속, ERROR 2002 (HY000) : Can't connect to local MySQL server db, my..
so-es-immer.tistory.com
'Database > MySQL' 카테고리의 다른 글
json_table, json_array를 활용하여한 delimiter로 여러 내용 출력하여 받기 (0) | 2022.06.13 |
---|