when I use:
CREATE DATABASE test;
ERROR 3680 (HY000): Failed to create schema directory 'test' (errno: 2 - No such file or directory)
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
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.