developer tip

데이터베이스 삭제 오류 ( '.test \'를 rmdir 할 수 없음, 오류 번호 : 17)

optionbox 2020. 7. 28. 08:26
반응형

데이터베이스 삭제 오류 ( '.test \'를 rmdir 할 수 없음, 오류 번호 : 17)


기본적으로 "mysqladmin -u root -p password"명령을 사용하여 루트 암호를 만드는 방법에 대해 배웠습니다.이 작업은 Windows 명령 편집기를 통해 수행되었습니다. 다음 프로세스는 "SHOW DATABASES;"를 사용하여 얻은 기본 데이터베이스 (정보 스키마, mysql 및 테스트)를 표시하는 것입니다.

그러나이 책에 따르면 중복 테스트 파일을 삭제해야했고 다음과 같은 오류 메시지가 나타납니다.

데이터베이스 삭제 오류 ( '.test \'를 rmdir 할 수 없음, 오류 번호 : 17)

사용 된 명령은 DROP DATABASE test;

MYSQL과 PHPMYADMIN을 사용하고 있습니다. 오류없이 파일을 삭제하는 방법에 대한 도움이 필요하십니까?


데이터베이스는 데이터 디렉토리 아래의 디렉토리 (일반적으로 /var/lib/mysql)로 표시되며 디렉토리는 테이블 데이터를 저장하기위한 것입니다.

DROP DATABASE문은 모든 테이블 파일을 제거하고 데이터베이스를 나타내는 디렉토리를 제거합니다. 그러나 테이블이 아닌 파일은 제거하지 않으므로 디렉토리를 제거 할 수 없습니다.

디렉토리를 제거 할 수없는 경우 MySQL에 오류 메시지가 표시됨

데이터베이스 디렉토리의 나머지 파일을 제거한 다음 디렉토리 자체를 제거하여 데이터베이스를 수동으로 제거 할 수 있습니다.


Mac에서 mysql 5.5를 새로 설치할 때도 동일한 문제가 발생했습니다. 테스트 스키마를 삭제하려고 시도했지만 오류 번호 17 메시지가 표시되었습니다. errno 17은 일부 posix os 함수가 파일이 존재하지 않아야하는 위치에 있음을 나타내는 오류입니다. 데이터 디렉토리에서 이상한 파일 ".empty"를 찾았습니다.

sh-3.2# ls -la data/test
total 0
drwxr-xr-x   3 _mysql  wheel  102 Apr 15 12:36 .
drwxr-xr-x  11 _mysql  wheel  374 Apr 15 12:28 ..
-rw-r--r--   1 _mysql  wheel    0 Mar 31 10:19 .empty

.empty 파일을 작성하면 drop database 명령이 성공했습니다.

.empty 파일의 출처를 모르겠습니다. 언급했듯이, 이것은 새로운 mysql 설치였습니다. 설치 과정에서 문제가 발생했을 수 있습니다.


mysql 설치를위한 datadir로 이동하여 데이터베이스를 수동으로 rm하십시오. 그것은 될 수 있습니다

/usr/local/var/mysql

그때,

rm -R <Your DB name>

설치에 대한 datadir을 확인하려면

vim the mysql.server file and find it there.

들어 phpMyAdmin을 로 이동 \ mysql을 \ 데이터 XAMPP 단순히 데이터베이스 폴더를 삭제합니다. 나를 위해 일했다!!


XAMPP 인 경우 다음을 수행하십시오.

cd /opt/lampp/var/mysql;
sudo su;
rm -rf test;

도움이 되었기를 바랍니다.


방금 WAMP와 함께 제공되는 phpMyAdmin 에서이 문제에 부딪 쳤습니다. 데이터베이스를 제거하고 오류를 제거하십시오. C:\wamp\bin\mysql\mysql5.5.24\data\해당 데이터베이스의 폴더 로 이동 하여 삭제했습니다.

그런 다음 phpMyAdmin에서 페이지를 새로 고치면 데이터베이스가 사라졌습니다.


지금까지 응답에 추가하기 위해 : Windows 10에서 데이터 파일은 여기에 보관됩니다 ...

C : \ ProgramData \ MySQL \ MySQL 서버 [mn] \ data

데이터베이스에 각 스키마에 대한 디렉토리가 있습니다. 삭제하려는 스키마 내부로 이동하여 불필요한 파일을 수동으로 삭제 한 후 drop 명령을 다시 시도하십시오.

데이터베이스에 대한 워크 벤치 변경 사항은이 위치에 저장됩니다. 예를 들어, 데이터베이스 중 하나에 대한 리버스 엔지니어링 연습을 수행하고 .mwb 파일에 저장된 변경 사항을이 위치에 저장하면이 오류가 발생했습니다.


두 가지를 확인해야 할 수도 있습니다.

1- 데이터베이스 폴더 권한 삭제하려는 데이터베이스는 mysql 프로세스와 동일한 소유자를 가져야합니다.

2- 디렉토리는 비어 있어야 합니다 mysql 데이터 디렉토리로 이동하여 디렉토리가 비어 있는지 확인하십시오

그런 다음 mysql cli를 연결하고 drop database 명령을 다시 실행하십시오.


이것을 통해 선택한 db에서 해당 캐시 파일을 제거한 다음 데이터베이스를 삭제 한 후

선택한 DB가 포함 된 MySQL 데이터 디렉토리를 먼저 찾으십시오.

리눅스

  • MySQL의 설정 파일을 엽니 다 : less /etc/my.cnf
  • "datadir"이라는 용어를 검색하십시오. / datadir

  • 존재하는 경우 다음 행을 강조 표시합니다. datadir = [path]

  • 해당 줄을 수동으로 찾을 수도 있습니다. 일반적으로 [mysqld] 섹션 제목 아래에서 찾을 수 있지만 반드시 찾을 필요는 없습니다.

  • 해당 행이 존재하지 않으면 MySQL은 기본적으로 / var / lib / mysql이됩니다.

Windows 1. MySQL의 구성 파일을 메모장에 엽니 다 : my.ini

The my.ini will be located in the MySQL program folder, which would be wherever it got installed. If you did not install MySQL, then use the Windows "search" feature to look for my.ini. You could also manually search for it by browsing to [drive]:\Program Files\MySQL\MySQL Server 5.5.

  1. Do a search in Notepad to find the term "datadir".

  2. If it exists, it will highlight a line that reads: datadir = [path]

  3. You can also manually look for that line. It typically would be found under a section heading of [mysqld] but it does not necessarily have to be found there.

  4. If that line does not exist, then you'll probably find it under [drive]:\ProgramData\MySQL\MySQL Server 5.5\data.

NOTE: The "ProgramData" folder may be hidden. You may have to type the explicit path into Windows Explore


In my case I didn't see any tables under my database on phpMyAdmin I am using Wamp server but when I checked the directory under C:\wamp\bin\mysql\mysql5.6.12\data I found this employed.ibd when I deleted this file manually I was able to drop the database from phpMyAdmin smoothly without any problems.


I my case the problem was a residual dump file in the database directory. That file was probably generated during a backup script test I had been working on. Once I manually deleted the file I could then drop the database.


I had the same issue (mysql 5.6 on mac) with 'can't rmdir..'-errors when dropping databases. Leaving an empty database directory not possible to get rid of. Thanks @Framework and @Beel for the solutions.

I first deleted the db directory from the Terminal in (/Applications/XAMPP/xamppfiles/var/mysql).

For further db drops, I also deleted the empty test file. In my case the file was called NOTEMPTY but still containing 0:

sudo ls -al test
total 0
drwxrwx---   3 _mysql  _mysql  102 Mar 26 16:50 .
drwxrwxr-x  18 _mysql  _mysql  612 Apr  7 13:34 ..
-rw-rw----   1 _mysql  _mysql    0 Jun 26  2013 NOTEMPTY

Chmod first and then

sudo rm -rf test/NOTEMPTY

No problems dropping databases after that


just go to data directory in my case path is "wamp\bin\mysql\mysql5.6.17\data" here you will see all databases folder just delete this your database folder the db will automatically drooped :)


You can delete the data in the sql directory.

For me i was using AMPPS on windows 10. I went to the AMPPs installtion directory. for me it was :

D:\Program Files (x86)\Ampps\mysql\data

because i have it installed on my secondary drive.

Then refresh your SQL client and you will see it's gone.

참고URL : https://stackoverflow.com/questions/4584458/error-dropping-database-cant-rmdir-test-errno-17

반응형