초보 개발자

su: warning: cannot change directory to /nonexistent: No such file or directory 본문

Error

su: warning: cannot change directory to /nonexistent: No such file or directory

taehyeki 2022. 2. 2. 17:07

MySQL 설치

WSL2 터미널에서 

 

아래 명령어로 Ubuntu 패키지를 업데이트합니다.

sudo apt update

 

아래 명령어로 mysql을 설치합니다.

sudo apt install mysql-server

 

설치확인하고 버전 번호를 확인합니다.

mysql --version

 

MySQL 시작

해당 명령어로 mysql을 실행합니다.

sudo /etc/init.d/mysql start

위 명령어를 실행한 후에 

아래와 같은 에러가 발생한다면

su: warning: cannot change directory to /nonexistent: No such file or directory

 

아래와 같이 명령어를 실행해줍니다. (리눅스OS에 따라 상이)

# Ubuntu
sudo service mysql stop
sudo usermod -d /var/lib/mysql/ mysql
sudo service mysql start