[phpMyAdmin Developers] Path location of db attached within phpMyAdmin

Isaac Bennetch bennetch at gmail.com
Sun Jun 21 03:29:07 CEST 2020


Hi,

On Sat, Jun 20, 2020 at 8:55 PM Kit Rodman via Developers
<developers at phpmyadmin.net> wrote:
>
> Hello and thank you, I have a db (MySQL) attached within phpMyAdmin but I can't seem to pin down an absolute path. Can you shed some light on where the db is located in the dir structure. I used phpMyAdmin restore to attach it.

I think I should first ask what your intentions are. This question is
usually a warning sign that "Whatever you're planning to do, you
shouldn't." There are very few reasons why you would need to directly
interact with the folder on disk. Backing up should be done through
mysqldump or some other special utility, import or export likewise
should not be handled by directly manipulating the files on disk.
They're in a binary format native to MySQL and you can damage your
database by working with the folders or files in this directory.

To directly answer, the MySQL data directory is the folder that
contains all of your databases (unless you do some advanced
configuration to split a database across multiple disks). That folder
depends on your operating system and how MySQL was installed. On
Linux, it's most commonly in /var/lib/mysql/. I believe the current
default path on Windows is C:\Program Files\MySQL\MySQL Server
8.0\data.

You can find the directory out by directly querying MySQL. From any
MySQL prompt (such as the SQL tab in phpMyAdmin, or the MySQL command
line client) you can use the command

SHOW VARIABLES LIKE "datadir";

Or from the phpMyAdmin graphical interface, you can use the
"Variables" tab across the top then search the results (you can filter
the results so you don't have to scroll).

Cheers,
Isaac

> Thank you for your assistance
>
> Kit
>
> Sent from Yahoo Mail on Android
> _______________________________________________
> Developers mailing list
> Developers at phpmyadmin.net
> https://lists.phpmyadmin.net/mailman/listinfo/developers



More information about the Developers mailing list