mysql 실행 시 -bash: mysql: command not found 오류 해결

안녕하세요? WEBPD.NET 서버운영팀입니다.

mysql 실행 시 -bash: mysql: command not found 오류 발생시 아래와 같이 해결하면 됩니다.

 

** mysql 실행 할때 mysql command를 찾을 수 없기 때문에 나오는 에러

mysql 은 /usr/local/mysql/bin 폴데 있으며 기본 path가 지정이 안되어 있으면 해당 디렉토리로 이동후 ./mysql 하면 실행이 된다.

 

** 해당 에러를 안보기 위해 PATH 지정 하는 방법!!!

vi /etc/profile  <--  profile를 열고 맨 마지막 줄에

export PATH="$PATH:/usr/local/mariadb/bin"  를 넣어준다.

저장한 후 쉘에서 source /etc/profile 를 하면 어느 디렉토리에서나 mysql를 실행 할 수 있다.

 

감사합니다.

Was this answer helpful? 0 Users Found This Useful (0 Votes)