1

when I use: CREATE DATABASE test;

ERROR 3680 (HY000): Failed to create schema directory 'test' (errno: 2 - No such file or directory)

1

1 Answer 1

3

Run this in the mysql client (or similar):

SHOW VARIABLES LIKE 'datadir';

Then look at the ownership and permissions for that directory. It should be owned by the mysql user, have the mysql group, and the mysql user should have read, write and execute (rwx) permissions, and I think similar for the group.

Which process is running the mysql daemon? It should be the mysql user. In Linux you can get a list of processes which includes the user who is running each. I assume you can do something similar on MacOSX (if that is what you're using).

Assuming this is a new installation, please see this documentation page about Initializing the data directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.