Are MySQL databases always stored in /var on CentOS?

25,410

Solution 1

In your case /var is stored on /dev/sda3 as a subdirectory of /.

The default datadir for MySQL is /var/lib/mysql and as long as you do not change the configuration, the database files are stored in this directory.

Solution 2

In *nix, if a directory is not a separate mount then it is part of its parent mount. In this case, /var is considered part of /.

Share:
25,410

Related videos on Youtube

inac
Author by

inac

Updated on September 17, 2022

Comments

  • inac
    inac over 1 year

    Are MySQL databases always stored in /var on CentOS?

    Specifically - If a new CentOS/cPanel server that needs to support MySQL, doesn't have that partition, but only has these, does that mean MySQL data is somehow being stored in a temporary dump somewhere?

    /dev/sda3              /
    tmpfs                  /dev/shm
    /dev/sda1              /boot
    /usr/tmpDSK            /tmp
    
    • Zoredache
      Zoredache almost 14 years
      The data directory can be relocated if you really want/need to do that. So it may not be always stored under /var, but that is the standard location.
    • inac
      inac almost 14 years
      Are there advantages to storing MySQL on /var ?