Change the Nextcloud data directory

Good afternoon.

I need to change the directory path with the data.
Before you enter the first time in the Next.
I did:
sudo systemctl stop httpd
sudo systemctl status httpd
mkdir / var / lib / mysql / nextcloud_data
mv / var / www / nextcloud / data / var / lib / mysql / nextcloud_data - move data
chown apache: apache / var / lib / mysql / nextcloud_data -R
chmod 755 / var / lib / mysql / nextcloud_data

sudo systemctl start httpd

When I enter the first time and specify the path to the data directory- /var/lib/mysql/nextcloud_data/data, I write an error: Error
Unable to create or write to directory
Tell me what am I doing wrong?

I solved the problem, I created the file .ocdata in / var / lib / mysql / nextcloud_data and gave him all the rights.
chown apache: apache / var / lib / mysql / nextcloud_data -R
chmod 755 / var / lib / mysql / nextcloud_data