Results 1 to 5 of 5

Thread: MySQL database files location

  1. #1

    Default MySQL database files location

    Hello,

    I had a VM with apache and mysql installed and databases. Due to unforseen circumstances i had to rebuild the VM. The original / drive now is mounted on another VM as a disk. I would love to take my databases from there. I cannot find anywhere were the database files are located so i can move them. on the internet it mentions /var/lib/mysql but this folder is empty.

    Anyone knows where in Leap they are?

    thank you

  2. #2

    Default Re: MySQL database files location

    MySQL's (and also MariaDB's) database files are in /var/lib/mysql/, unless configured manually otherwise.

    But note that the folder and the files have to be owned by (and read-/writeable for) the user mysql, or it won't be able to access them.

  3. #3
    Join Date
    Sep 2014
    Location
    Germany
    Posts
    416

    Default AW: MySQL database files location

    Quote Originally Posted by vasgi View Post
    ... Anyone knows where in Leap they are? ...
    check the file "/etc/my.cnf". If that contains a definition like "datadir = PATH_TO_YOUR_DATABASE" you will find the database files under "PATH_TO_YOUR_DATABASE" otherwise the default is used (which is "/var/lib/mysql"). To make sure you have sufficient rights to see/move the database files, you should look for them as "root".

    Best regards

    susejunky

  4. #4
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    20,424
    Blog Entries
    14

    Default Re: MySQL database files location

    Quote Originally Posted by vasgi View Post
    Hello,

    I had a VM with apache and mysql installed and databases. Due to unforseen circumstances i had to rebuild the VM. The original / drive now is mounted on another VM as a disk. I would love to take my databases from there. I cannot find anywhere were the database files are located so i can move them. on the internet it mentions /var/lib/mysql but this folder is empty.

    Anyone knows where in Leap they are?

    thank you
    If you look in /var/lib/mysql on the other VM, and that folder's empty, this just means that VM is not running mysql at all. You have to look beyond the mountpoint where you mounted the original VM as a disk. Your databases should be in MOUNTPOINT/var/lib/mysql
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  5. #5

    Default Re: MySQL database files location

    Hello,

    I solved the issue. actually the files were really not there. Thank me that i keep backups!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •