Steps to change the MySQL data directory location.

KB ID : 115037
Published : Dec. 16, 2016
Created : Dec. 16, 2016
Last Modified : Dec. 16, 2016

Challenge

Migrating Vembu BDR internal database (MySQL) data files from one location to another location.

Solution

For Windows

  • Stop the Vembu BDR and MySQL Services in services.msc

  • Open “my.ini” file present in MySQL installation location and navigate to "datadir" attribute, you can find the current "data" folder location.

  • Copy the MySQL "data" folder present in old location to the new location.

  • Update the "datadir" attribute with the new location in the “my.ini” file

  • Start Vembu BDR and MySQL service.

For Ubuntu

  • Stop the Vembu BDR and MySQL Services! You can stop the services using below cmd:

    • /etc/init.d/mysql stop
    • /etc/init.d/vembubdr stop
  • Now please navigate to the location "/var/lib/". After once navigated to that location, you can now able to find the "mysql" folder.

  • Copy the "mysql" folder to the new location.

  • Open my.cnf file which is available in the location "/etc" and navigate to "datadir" attribute. Now update the "datadir" attribute with the new location(Where you have copied the "mysql" folder) in the “my.cnf” file

  • Start Vembu BDR and MySQL service.

    • /etc/init.d/mysql start
    • /etc/init.d/vembubdr start
edit retag flag offensive close merge delete