I accidentally formatted my hard drive and re-installed Windows and forgot to backup an important database I had in my MySQL server. I'm trying to salvage files now using some software, but I don't know what to look for.
What is the path that the files are stored in, and what are the files named (what naming convention, or file extension should I look for)?
I believe my server was using MyISAM, but not 100% sure.
The default data directory location is C:\Program Files\MySQL\MySQL Server 8.0\data , or C:\ProgramData\Mysql on Windows 7 and Windows Server 2008. The C:\ProgramData directory is hidden by default.
Typically, MySQL will store data in the default directory of /var/lib/mysql.
db file might be located at either of these locations: C:\Users\[username]\AppData\Local\Packages\Microsoft. SkypeApp_kzf8qxf38zg5c\LocalState\\main. db.
The default database file location for server instances depends on the version of the Microsoft SQL Server software: SQL Server 2014 — C:\Program Files\Microsoft SQL Server\MSSQL12. MSSQLSERVER\MSSQL\DATA\ SQL Server 2016 — C:\Program Files\Microsoft SQL Server\MSSQL13.
You can check my.ini
file to see where the data folder is located.
Usually there is a folder {mysqlDirectory}/data
MySQL data storage:
Commands.frm Commands.myd Commands.myi
The *.frm files contain the table definitions. Your *.myi files are MyISAM index files. Your *.myd files contain the table data.
Edit/Update. Because of the interest shown in the question here is more info which is found also in the comments.
In Windows 8.1, the MySQL databases are stored (by default) here: C:\ProgramData\MySQL\MySQL Server 5.6\data
The folder C:\ProgramData is a hidden folder, so you must type it into Windows Explorer address to get there. In that data folder, the databases are named /{database_name_folder}/{database_tables_and_files}
.
For instance,
C:\ProgramData\MySQL\MySQL Server 5.6\data\mydatabase\mytable.frm C:\ProgramData\MySQL\MySQL Server 5.6\data\mydatabase\mytable.ibd
Thank @marty-mcgee for this content
In Windows 7, the MySQL database is stored at
C:\ProgramData\MySQL\MySQL Server 5.6\data
Note: this is a hidden folder. And my example is for MySQL Server version 5.6; change the folder name based on your version if different.
It comes in handy to know this location because sometimes the MySQL Workbench fails to drop schemas (or import databases). This is mostly due to the presence of files in the db folders that for some reason could not be removed in an earlier process by the Workbench. Remove the files using Windows Explorer and try again (dropping, importing), your problem should be solved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With