# Newbie: change data dir and user.

**URL:** <https://forums.percona.com/t/newbie-change-data-dir-and-user/6435>\
**Category:** Percona Server for MySQL 5.7\
**Created:** [June 30, 2018, 3:57am UTC](https://forums.percona.com/t/newbie-change-data-dir-and-user/6435 "2018-06-30T03:57:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GrayWolf82](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/graywolf82/32/49_2.png) [@GrayWolf82](https://forums.percona.com/u/GrayWolf82)\
**Post date:** [June 30, 2018, 3:57am UTC](https://forums.percona.com/t/newbie-change-data-dir-and-user/6435/1 "2018-06-30T03:57:50Z")

</div>

Hi. I need change data dir for percona. But, when i do init with this patameters:

sudo mysqld --initialize --user=[user] --basedir=/home/[user]/percona --datadir=/home/[user]/percona/base

i can`t connect to database: ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES).  
But, when i do like that: sudo mysqld --initialize --user=mysql --basedir=/usr --datadir=/var/lib/mysql all work good

And one more question: how to change mysql user to [user]? It is necessary that the perсona work on behalf of the user [user]
