Not the answer you need?
Register and ask your own question!

Mysql Data store folder change

ronironi EntrantCurrent User Role Beginner
I have installed Percona mysql in my ubuntu server successfully. I need to move percona data location from /var/lib/mysql to /mysql-data directory.Because /mysql-data directory is encrypted volume.How to move percona data folder into this location

Comments

  • przemekprzemek Percona Support Engineer Percona Staff Role
    * stop mysql server
    * change the /mysql-data directory owner and group to the same as /var/lib/mysql, and to the same chmod
    * copy the data files and directories to the new directory (including the /var/lib/mysql/mysql directory)
    * make sure the rights on destination directory/files are correct again
    * add
    datadir = /mysql-data
    to your mysql config
    * restart the server
  • ronironi Entrant Current User Role Beginner
    Thanks
    Its works
  • prince85prince85 Contributor Current User Role Novice
    While I'm having the same permission to the new dir still couldn't start the mysql.

    [[email protected] mysql]# ls -ltr /data/
    total 20
    drwx
    . 2 root root 16384 Feb 14 15:14 lost+found
    drwxr-xr-x. 5 mysql mysql 4096 Feb 14 17:48 mysql


    [[email protected] mysql]# ls -ltr /var/lib/ |grep mysql
    drwxr-x---. 2 mysql mysql 6 Dec 18 17:35 mysql-keyring
    drwxr-x---. 2 mysql mysql 6 Feb 14 17:48 mysql-files
    drwxr-x--x. 5 mysql mysql 4096 Feb 15 12:36 mysql
  • przemekprzemek Percona Support Engineer Percona Staff Role
    Check if you have SElinux enabled.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.