Mac端XAMPP数据库定位问题:创建后找不到数据库文件夹
Hey Matt, let's straighten out this confusion first—your YouTube reference might have been showing a Windows XAMPP setup, because on Mac, XAMPP stores MySQL database files outside of the htdocs folder entirely. Here's how to locate them:
Default Database Path on Mac XAMPP:
The MySQL data directory lives at this path:/Applications/XAMPP/xamppfiles/var/mysql/Inside this folder, you'll see folders named after every database you've created (including default system ones like
mysql,information_schema). Each folder contains the actual table files (like.frm,.ibd) tied to that database.Verify the Path via phpMyAdmin (For Absolute Certainty):
If you want to confirm the exact path for your specific XAMPP installation:- Open
localhost:8080/phpmyadminin your browser - Click the Variables tab at the top of the page
- Use the search bar to look for
datadir—the value displayed here will show you the precise directory where your databases are stored, no guesswork involved.
- Open
Why the YouTube Video Showed htdocs?:
That's likely either a Windows-specific setup (where XAMPP's default paths differ) or a tutorial that manually moved the database directory to htdocs (a non-standard configuration). On Mac, XAMPP keeps web files (htdocs) and database files completely separate for security and organizational best practices.
内容的提问来源于stack exchange,提问作者Matt

