현재 mac(big sur)을 쓰면서 개발을 공부 중인 초보 개발자입니다.
mariadb를 brew로 설치하고 root로 접속한 후
2가지의 문제에 봉착했습니다.
1. 데이터베이스 생성 오류
$ create database test
를 치니 에러가 나오네요. 에러 내용은 아래와 같습니다.
ERROR 3680 (HY000): Failed to create schema directory 'test' (errno: 2 - No such file or directory)
2. table 생성오류
use mysql로 접속해서 예제 table을 만들어보려고 하는데 에러가 나네요..
에러는 다음과 같습니다.
ERROR 1030 (HY000): Got error 168 - 'Unknown (generic) error from engine' from storage engine
여러군대 구글링해보다가 재설치 권하는 글에 재설치도 해보고 , 디렉토리에 권한을 줘야한다는 글을 보고
$ ls -al /usr/local/var | grep mysql
>> drwxrwxr-x 8 _mysql _mysql 256 1 4 22:36 mysql
이렇게 mysql 폴더에 권한도 주어보았는데 소용이 없네요.. 제가 영어도 부족하고 컴퓨터 지식도 부족해서 그런지 많이 벅차네요 또 맥이라서 이런부분은 좀 불편한것같습니다 ㅠ
혹시 이 부분에 대해 아는게 있으시면 도와주실 수 있으신가요?
추가 버전 정보 : mac big sur(11.1)
mariadb(stable 10.5.8 (bottled))
입니다.
답변 감사합니다!
https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization.html 에 나온대로
/bin mysqld --initialize --user=mysql 에서 초기화를 해보았는데 다음과같은 에러가 나옵니다.. 이거는 또 무엇인지 ㅠ
산넘어 산이네요
➜ /bin mysqld --initialize --user=mysql
2021-01-05 9:39:48 0 [Note] mysqld (mysqld 10.5.8-MariaDB) starting as process 90224 ...
2021-01-05 9:39:48 0 [Warning] Can't create test file /usr/local/var/mysql/JK-Mac.lower-test
mysqld: One can only use the --user switch if running as root
2021-01-05 9:39:48 0 [ERROR] mysqld: File '/usr/local/var/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
2021-01-05 9:39:48 0 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/usr/local/var/mysql/aria_log_control'
2021-01-05 9:39:48 0 [ERROR] Plugin 'Aria' init function returned error.
2021-01-05 9:39:48 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2021-01-05 9:39:48 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2021-01-05 9:39:48 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2021-01-05 9:39:48 0 [ERROR] Plugin 'InnoDB' init function returned error.
2021-01-05 9:39:48 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2021-01-05 9:39:48 0 [Note] Plugin 'FEEDBACK' is disabled.
2021-01-05 9:39:48 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
2021-01-05 9:39:48 0 [ERROR] Failed to initialize plugins.
2021-01-05 9:39:48 0 [ERROR] Aborting
➜ /bin