/
Changing MySQL data directory

Changing MySQL data directory

1.Stop MySQL server

2. Copy default mysql folder to a different location, for example /mnt/mysql

3. change datadir and socket to new location in /etc/my.cnf, for example,

datadir=/mnt/mysql

socket=/mnt/mysql/mysql.sock

4. add [client] section into /etc/my.cnf like below

[client]

socket=/mnt/mysql/mysql.sock

5. edit /etc/phpMyAdmin/config.php, change

$cfg['Servers'][$i]['host'] = 'localhost';

to

$cfg['Servers'][$i]['host'] = '127.0.0.1';

6. add below line to /etc/phpMyAdmin/config.php with new socket file location

$cfg['Servers'][$i]['socket']='/mnt/mysql/mysql.sock';

7. For TDDP, create mysql user webuser@127.0.0.1 with no password 

8. change 'hostname' in /var/www/r16/global_config.php from 'localhost' to '127.0.0.1' 

9. restart mysql 

10.restart httpd 

11. check if data directory is successfully changed by running below command

  mysql -uUSER -p -e 'SHOW VARIABLES WHERE Variable_Name LIKE "%dir"'

Related content

TDDP troubleshooting guide
TDDP troubleshooting guide
More like this
TDDP MySQL Backup and cron job creation
TDDP MySQL Backup and cron job creation
More like this
Migration Guide
Migration Guide
More like this
Backup installation and configurations for TDDP and DOI data
Backup installation and configurations for TDDP and DOI data
More like this
Manual Creation of TDDP server
Manual Creation of TDDP server
More like this
Provision and Configure TDDP instance on Nectar cloud
Provision and Configure TDDP instance on Nectar cloud
More like this