Drop database - errno: 39

0

I'm trying to remove a database but i'm getting this error: SQL Error [1010] [HY000]: Error dropping database (can't rmdir './databasename', errno: 39)

I've been reading solutions, but it looks like i need access to the file system.

Mauro
asked 21 days ago141 views
1 Answer
0

This error code means mainly the directory is not empty. If you just want to drop the database no matter what you can follow the below steps.

  1. find the datadir with the command SHOW VARIABLES WHERE Variable_name LIKE '%datadir%';
  2. stop the MySQL server (e.g. service mysql stop or rcmysqld stop or similar on Linux, NET STOP <name of MYSQL service, often MYSQL57 or similar> or
    through SERVICES.MSC on Windows)
  3. go to the datadir (this is where you should investigate; see below)
  4. remove the directory with the same name as the database
  5. start MySQL server again and connect to it
  6. execute a DROP DATABASE

Errno 39 This code means "directory not empty". The directory contains some hidden files MySQL knows nothing about. For non-hidden files, see Errno 17.

Errno 17 This code means "file exists". The directory contains some MySQL file that MySQL doesn't feel about deleting. Such files could have been created by a SELECT ... INTO OUTFILE "filename"; command where filename had no path. In this case, the MySQL process creates them in its current working directory,

AWS
answered 21 days ago
  • In rds we don't have access to the file system

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions