Program Tip

MySQL은 Windows에서 데이터베이스 파일을 어디에 저장하며 파일 이름은 무엇입니까?

programtip 2020. 10. 26. 08:28
반응형

MySQL은 Windows에서 데이터베이스 파일을 어디에 저장하며 파일 이름은 무엇입니까?


그래서 실수로 하드 드라이브를 포맷하고 Windows를 다시 설치하고 MySQL 서버에있는 중요한 데이터베이스를 백업하는 것을 잊었습니다. 현재 일부 소프트웨어를 사용하여 파일을 복구하려고하는데 무엇을 찾아야할지 모르겠습니다.

파일이 저장되는 경로는 무엇이며 파일의 이름은 무엇입니까 (어떤 이름 지정 규칙 또는 파일 확장자를 찾아야합니까)?

내 서버가 MyISAM을 사용하고 있다고 생각하지만 100 % 확실하지는 않습니다.

조언을 주시면 감사하겠습니다!


my.ini파일을 확인하여 데이터 폴더의 위치를 ​​확인할 있습니다.

일반적으로 {mysqlDirectory} / data 폴더가 있습니다.

MySQL 데이터 스토리지 :

Commands.frm
Commands.myd
Commands.myi

* .frm 파일에는 테이블 정의가 포함되어 있습니다. * .myi 파일은 MyISAM 인덱스 파일입니다. * .myd 파일에는 테이블 데이터가 포함됩니다.

편집 / 업데이트 . 질문에 표시된 관심으로 인해 댓글에서도 더 많은 정보를 찾을 수 있습니다.

Windows 8.1에서 MySQL 데이터베이스는 기본적으로 여기에 저장됩니다. C:\ProgramData\MySQL\MySQL Server 5.6\data

C : \ ProgramData 폴더는 숨겨진 폴더이므로 Windows 탐색기 주소에 입력해야합니다. 해당 데이터 폴더에서 데이터베이스 이름은 /{database_name_folder}/{database_tables_and_files}.

예를 들어

C:\ProgramData\MySQL\MySQL Server 5.6\data\mydatabase\mytable.frm
C:\ProgramData\MySQL\MySQL Server 5.6\data\mydatabase\mytable.ibd 

이 콘텐츠에 대해 @ marty-mcgee에게 감사드립니다.


Windows 7에서 MySQL 데이터베이스는 다음 위치에 저장됩니다.

C : \ ProgramData \ MySQL \ MySQL Server 5.6 \ data

참고 : 이것은 숨겨진 폴더입니다. 제 예는 MySQL Server 버전 5.6입니다. 버전이 다른 경우 폴더 이름을 변경하십시오.

때때로 MySQL Workbench가 스키마 삭제 (또는 데이터베이스 가져 오기)에 실패하기 때문에이 위치를 아는 것이 편리합니다. 이는 주로 어떤 이유로 워크 벤치가 이전 프로세스에서 제거 할 수없는 db 폴더에 파일이 있기 때문입니다. Windows 탐색기를 사용하여 파일을 제거하고 다시 시도 (삭제, 가져 오기)하면 문제가 해결됩니다.

도움이 되었기를 바랍니다 :)


루트에 기본 my-default.ini 파일이 있고 하나의 서버 구성이 있습니다.

[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

그래서 그것은 나에게 경로를 말하지 않습니다.

가장 좋은 방법은 데이터베이스에 연결하고 다음 쿼리를 실행하는 것입니다.

SHOW VARIABLES WHERE Variable_Name LIKE "%dir" ;

그 결과는 다음과 같습니다.

basedir                     C:\Program Files (x86)\MySQL\MySQL Server 5.6\
character_sets_dir          C:\Program Files (x86)\MySQL\MySQL Server 5.6\share\charsets\

datadir                     C:\ProgramData\MySQL\MySQL Server 5.6\Data\
innodb_data_home_dir    
innodb_log_group_home_dir   .\
lc_messages_dir             C:\Program Files (x86)\MySQL\MySQL Server 5.6\share\

plugin_dir                  C:\Program Files (x86)\MySQL\MySQL Server 5.6\lib\plugin\

slave_load_tmpdir           C:\Windows\SERVIC~2\NETWOR~1\AppData\Local\Temp
tmpdir                      C:\Windows\SERVIC~2\NETWOR~1\AppData\Local\Temp

데이터베이스에 대해 구성된 모든 매개 변수를 보려면 다음을 실행하십시오.

SHOW VARIABLES;

storage_engine 변수는 InnoDb 또는 MyISAM을 사용하고 있는지 알려줍니다.


Windows 7 : c : \ users \ all users \ MySql \ MySql Server xx \ Data \

여기서 xx는 컴퓨터에 설치된 SQL Server의 버전 번호입니다.

피델


{install path} \ data 여야합니다. 예 : C:\apps\wamp\bin\mysql\mysql5.5.8\data\{databasename}


일반적으로 아래 지정된 폴더에 있지만 ProgramData는 일반적으로 숨겨진 폴더입니다. 표시하려면 제어판으로 이동하여 "폴더"를 검색 한 다음 고급 설정에서 숨김 파일 표시를 선택하고 적용을 클릭합니다. C : / ProgramData / MySQL / MySQL Server 5.5 / Data /


로컬 파티션에서 * .myi 파일에 대한 Windows 검색을 수행하십시오. 기간.

내가 예상했듯이 대부분의 다른 데이터베이스 관리자와 같이 적절한 데이터 전용 폴더를 사용하는 대신 프로그램 파일 폴더 안에 위치했습니다.

my.ini 파일을 검색하고, 편집기로 열고, 경로 문자열을 조회하고, 구성 파일 (!)을 변경하지 않았는지 확인한 다음 두 번째 검색을 수행하는 이유는 무엇입니까? 터치 타이핑을 연습하는 것 외에 추가적인 이점없이 복잡합니다.


방금 Windows7에 MySQL 5.7을 설치했습니다. 데이터베이스 파일은 숨겨진 다음 디렉토리에 있습니다.C:\ProgramData\MySQL\MySQL Server 5.7\Data

my.ini파일은 동일한 루트에 있습니다 :C:\ProgramData\MySQL\MySQL Server 5.7


MYSQL 8.0 :

my.ini디스크에서 검색 하면 다음 폴더를 찾을 수 있습니다.

C : \ 경우 ProgramData \ MySQL은 \ MySQL 서버 8.0
그것은이다 ProgramData,하지Program file

데이터가 하위 폴더에 있습니다 : \Data.

각각 database은 폴더를 소유하고 각 table파일 index은 1 개 이상의 파일입니다.

다음은 샘플 데이터베이스입니다 sakila.여기에 이미지 설명 입력


in MySQL are
".myd" a database self and
".tmd" a temporal file.
But sometimes I see also ".sql".

It depends on your settings and/or export method.


If you're using Win10 with Xampp server installed, then you can find the data folder in C:\xampp\mysql\data

Inside the data folder, each database has its own folder which in turn contains the .frm, .myi and .myd files which represent for a single table in the database.

If for instance, you created a database with the name: myschool and inside the database, you have three tables with the names:

  1. Nursery
  2. Primary
  3. Secondary

Then, you will have for the Nursery table: nursery.frm, nursery.myi and nursery.myd. Same will go for the Primary and Secondary tables. Thus, in the I mentioned here, you will a total of 9 files inside the database folder named myschool.

You can then copy the database folder and use it in your new mysql installation data folder.

I hope this helps.

Best regards.


1) Locate the my.ini, which store in the MySQL installation folder.

For example,

C:\Program Files\MySQL\MySQL Server 5.1\my.ini

2) Open the “my.ini” with our favor text editor.

#Path to installation directory. All paths are usually resolved relative to this.
basedir="C:/Program Files/MySQL/MySQL Server 5.1/"

#Path to the database root/"
datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data

Find the “datadir”, this is the where does MySQL stored the data in Windows.


C:\Program Files\MySQL\MySQL Workbench 6.3 CE\sys

paste URLin to window file, and get Tables, Procedures, Functions from this directory

참고 URL : https://stackoverflow.com/questions/12947668/where-does-mysql-store-database-files-on-windows-and-what-is-the-name-of-the-fil

반응형