programing

테스트 파일 하위 테스트 시작 서버 mysql을 만들 수 없습니다.

yoursource 2023. 9. 4. 22:50
반응형

테스트 파일 하위 테스트 시작 서버 mysql을 만들 수 없습니다.

저는 JDBC 프로그래밍을 만드는 방법에 대해 이 튜토리얼을 따르고 있습니다.서버를 시작하기 위해 콘솔 명령까지 단계를 수행했습니다.

// For Windows

cd {path-to-mysql-bin}   // Check your MySQL installed directory
mysqld --console

다음 오류 메시지가 표시됩니다.

mysqld: Can't change dir to 'C:\Program Files\MySQL\MySQL Server 5.7\data\' (Errcode: 2 - No such file or directory)
2017-01-06T10:54:36.968210Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-01-06T10:54:36.968210Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2017-01-06T10:54:36.968210Z 0 [Note] mysqld (mysqld 5.7.17) starting as process 11248 ...
2017-01-06T10:54:36.974226Z 0 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.7\data\DESKTOP-DEQ2IC2.lower-test
2017-01-06T10:54:36.975229Z 0 [Warning] Can't create test file C:\Program Files\MySQL\MySQL Server 5.7\data\DESKTOP-DEQ2IC2.lower-test
2017-01-06T10:54:36.975229Z 0 [ERROR] failed to set datadir to C:\Program Files\MySQL\MySQL Server 5.7\data\
2017-01-06T10:54:36.976231Z 0 [ERROR] Aborting

2017-01-06T10:54:36.977234Z 0 [Note] Binlog end
2017-01-06T10:54:36.978237Z 0 [Note] mysqld: Shutdown complete

MySql을 이런 식으로 사용하는 것은 처음이지만 서버 디렉토리에 데이터 폴더가 없고 데이터 디렉토리가 있는 곳에 구성 정보가 저장되어 있다고 생각되는 my.ini 파일이 없습니다.또한 제가 읽은 윈도우 설치 프로그램을 사용하여 MySql을 설치했는데, 그 이유는 my.ini 파일이 없고 템플릿 my-default.ini 파일만 있기 때문일 수 있습니다.

왜 이런 일이 일어나는지 아는 사람?

에 폴더 C:\Program Files\MySQL\MySQL Server 8.0.

다음을 사용하여 새 파일 만들기

(ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';) 

암호 재설정 명령(필요한 경우)

이 파이다위있확인다니합는지에 합니다.C:드라이브. 루트 폴더.

그런 다음 다음 명령을 실행합니다.

C:\> cd "C:\Program Files\MySQL\MySQL Server 8.0\bin"
C:\> mysqld --init-file=C:\\mysql-init.txt

위에서 언급한 대로 "데이터" 폴더를 만듭니다. (그 후 오류가 표시되지 않았지만 시작되지 않았습니다.)
그런 다음 창에서 services.msc로 이동하고 여기서 시작합니다.또한 창을 시작할 때마다 자동으로 시작되도록 자동으로 설정합니다.그것은 나에게 효과가 있었다.

는 명령을 실행했습니다.bin\mysqld --initialize --console모든 것이 해결되었습니다.경우에 따라 데이터 폴더를 먼저 만들어야 합니다.창과 나머지 창에는 서로 다른 매개 변수가 있습니다.

다음 링크를 참조하십시오.
https://dev.mysql.com/doc/refman/8.0/en/.htmlhttps ://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization.html
https://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization.html#://dev.mysql.com/doc/refman/8.0/en/data-directory-initialization.html#data-directory-initialization-password-assignment
https://dev.mysql.com/doc/refman/8.0/en/.htmlhttps ://dev.mysql.com/doc/refman/8.0/en/option-files.html

MySQL 설치 마법사를 사용하여 MySQL을 설치하는 경우 실행 경로는 설치한 위치입니다."C:\Program Files\My"와 같은 것입니다.SQL\MySQL Server 8.0\bin"입니다.my.init 파일이 ProgramData에 있으며 init 파일의 경로는 "C:\ProgramData\My"와 같을 수 있습니다.SQL\MySQL Server 8.0"입니다.위치에서 볼 수 없는 경우에는 숨김 여부를 확인해 주시기 바랍니다.

오류 설명 "테스트 파일 C:\Program Files\My를 만들 수 없습니다.SQL\MySQL Server 5.7\data...", MySQL 설치 위치에 'data'라는 폴더가 없습니다.대부분 'my.init' 파일이 있는 곳에 상주할 수 있습니다(ProgramData).그렇지 않으면 폴더 이름이 '데이터'가 아니라 '데이터'일 수 있습니다.

데이터 폴더를 init-file 존재 위치에서 복사하여 실행 파일 위치에 붙여넣을 수 있습니다.또한 대문자로 표시된 폴더의 이름을 데이터로 변경합니다.

저의 경우 Windows 설치 관리자가 설치된 MySQL을D:/Windows 서비스로 실행되지 않도록 설정되었습니다.나는 이사를 통해 문제를 해결할 수 있었습니다.my.iniC에서:\ProgramData\MySQL\MySQL Server 8.0에서 MySQL 설치 폴더로 이동합니다.

이 오류는 저에게 발생합니다.솔루션이 편집되었습니다.\Program Files\xampp\mysql\data\my.ini에서 디렉토리를 D: 경로로 변경합니다.

[mysqld]
datadir=D:\program files\xampp\mysql\data
[client]

저도 비슷한 문제를 해결할 수 있었습니다.

C:\Program Files\MySQL\MySQL Server 8.0\bin>**mysqld --console**
2021-02-27T23:46:09.919345Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.23) starting as process 7296
2021-02-27T23:46:09.926583Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\mysqld_tmp_file_case_insensitive_test.lower-test
2021-02-27T23:46:09.926798Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\mysqld_tmp_file_case_insensitive_test.lower-test
2021-02-27T23:46:09.927086Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to 'C:\Program Files\MySQL\MySQL Server 8.0\data\' (OS errno: 2 - No such file or directory)
2021-02-27T23:46:09.933751Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-02-27T23:46:09.934110Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.23)  MySQL Community Server - GPL.

해결책은 my.ini 파일을 다시 생성해야 한다는 것이었습니다.C:\ProgramData\MySQL\MySQL Server 8.0여기에 추가합니다.

[mysqld]
datadir=C:\ProgramData\MySQL\MySQL Server 8.0\Data

인코딩을 ANSI로 설정하고 파일을 저장합니다.

그런 다음 서비스를 시작할 수 있습니다.

"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" MySQL80

새로운 MSI 설치 프로그램으로 설치해도 문제가 해결되지 않았고, 위에서 언급한 내용을 적용할 때까지 계속 작동하지 않았습니다.

저의 경우, 데이터 폴더가 존재하지 않기 때문에 데이터 폴더를 만들고 작업을 시작했습니다.

xampp-portable-windows-x64-8.0.8-0-VS16의 경우 \xampp \readme_en.txt에 언급된 대로 드라이브 루트만 배치하면 작동했습니다.

NOTE: Unpack the package to your USB stick or a partition of your choice.
There it must be on the highest level like E:\ or W:\.

도움이 되기를 바랍니다.

이 스레드의 처음에 언급된 것과 같은 문제를 발견했는데, 관리자 모드(윈도우)에서 콘솔을 실행하는 것이 요령이었습니다."폴더를 찾을 수 없습니다." 등과 관련된 오류 메시지는 프로그램이 요청 시 이러한 폴더와 파일을 만들 수 없기 때문입니다.건배.

관리 모드에 있지 않고 서버를 실행하려고 할 때 발생했습니다.관리 모드에서 콘솔 다시 시작을 시도한 다음 다시 시도하기 전에 sql server 8.0 디렉토리로 이동합니다.

명령 프롬프트 - 관리자 권한으로 mysqld를 시작했습니다.이 문제는 해결되었습니다.테스트 파일을 만들 수 없습니다. 권한 문제입니다.

언급URL : https://stackoverflow.com/questions/41504580/cant-create-test-file-lower-test-start-server-mysql

반응형