# Moving data directory to another location

**URL:** <https://forums.percona.com/t/moving-data-directory-to-another-location/4033>\
**Category:** Other MySQL® Questions\
**Created:** [January 31, 2015, 7:15pm UTC](https://forums.percona.com/t/moving-data-directory-to-another-location/4033 "2015-01-31T19:15:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![msaqibansari](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@msaqibansari](https://forums.percona.com/u/msaqibansari)\
**Post date:** [January 31, 2015, 7:15pm UTC](https://forums.percona.com/t/moving-data-directory-to-another-location/4033/1 "2015-01-31T19:15:30Z")

</div>

Recently i installed fresh copy of Percona MySql 5.6 on server. I created my.cnf with following parameters but when i start “/etc/init.d/mysql start” i got “Starting MySQL (Percona Server). ERROR! The server quit without updating PID file (/home/databases/server.pid).” error.

Note: It works properly when i move /etc/my.cnf to another location.

[mysqld]  
datadir=/home/databases  
socket=/var/lib/mysql/mysql.sock  
user=mysql

# Disabling symbolic-links is recommended to prevent assorted security risks

symbolic-links=0

thread-cache-size=50  
join-buffer-size=4M  
max\_allowed\_packet=64M  
table-cache=1024  
tmp-table-size=64M  
max-heap-table-size=64M  
key-buffer-size=256M

innodb\_buffer\_pool\_size=512M  
innodb\_log\_buffer\_size=8M  
#innodb\_log\_file\_size=64M  
innodb\_log\_file\_size = 5242880  
innodb\_flush\_log\_at\_trx\_commit=2  
innodb\_thread\_concurrency=8  
innodb\_flush\_method=O\_DIRECT  
innodb\_file\_per\_table  
innodb\_file\_format=barracuda  
innodb\_lazy\_drop\_table=1

[mysqld\_safe]  
log-error=/home/databases/log/mysqld.log  
pid-file=/var/run/mysqld/mysqld.pid

Whats wrong with this configuration file.

Thanks & Regards

---

<div class="post-metadata">

**Author:** ![scott.nemes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/scott.nemes/32/5_2.png) [@scott.nemes](https://forums.percona.com/u/scott.nemes)\
**Post date:** [February 1, 2015, 6:08pm UTC](https://forums.percona.com/t/moving-data-directory-to-another-location/4033/2 "2015-02-01T18:08:15Z")

</div>

Hi msaqibansari;

It is most likely an ownership/permissions issue. Do you have SELinux or AppArmor enabled on the server? If so, try disabling it temporarily to see if that is the issue. If it is, you’ll need to update the rules to allow for the new location. If that is not it, then check the directory/file ownership and permissions on the new datadir to make sure it matches the original location to allow MySQL to properly run there.

-Scott
