# How  to compile the percona server to be placed completely in one directory?

**URL:** https://forums.percona.com/t/how-to-compile-the-percona-server-to-be-placed-completely-in-one-directory/6431
**Category:** Other MySQL® Questions
**Created:** [June 27, 2018, 3:39am UTC](https://forums.percona.com/t/how-to-compile-the-percona-server-to-be-placed-completely-in-one-directory/6431 "2018-06-27T03:39:24Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![kanevbg](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kanevbg/32/48_2.png) [@kanevbg](https://forums.percona.com/u/kanevbg)
#### Post date: [June 27, 2018, 3:39am UTC](https://forums.percona.com/t/how-to-compile-the-percona-server-to-be-placed-completely-in-one-directory/6431/1 "2018-06-27T03:39:24Z")

</div>

I have build Percona MySQL server 5.7 with this configuration:

```auto
cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DWITH_EMBEDDED_SERVER=OFF -DCMAKE_INSTALL_PREFIX=/opt/percona-server-5.7_5.7.22-22 -DMYSQL_DATADIR=/opt/percona-server-5.7_5.7.22-22/data

```

The server is now having log at /var/mariadb/xxxxx…  
I would like to build it in a way that everything to be stored in one root directory for easier multi-version environment.  
I will have to do the same build with version 5.6 and when it comes with v8

---

<div class="post-metadata">

### Author: ![kanevbg](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kanevbg/32/48_2.png) [@kanevbg](https://forums.percona.com/u/kanevbg)
#### Post date: [June 29, 2018, 9:39am UTC](https://forums.percona.com/t/how-to-compile-the-percona-server-to-be-placed-completely-in-one-directory/6431/2 "2018-06-29T09:39:37Z")

</div>

I tried with the documented cmake parameters in MySQL 5.7 site but they do not make any change. How this can be achieved? Event the  
-DMYSQL\_DATADIR seems to be ignored when set to /opt/percona-server-5.7\_5.7.22-22/var/data (for example) it still creates /opt/percona-server-5.7\_5.7.22-22/data This is so annoying problem, please help!
