Problem when changing mysql data directory in centos 7

17 views Asked by At

I have changed mysql data directory but there is still old path reflected

I used following method

mkdir /data/mysql
rsync -av /var/lib/mysql/ /data/mysql

Edit etc/my.cnf with following lines

datadir=/data/mysql
socket=/data/mysql/server.sock

But when im checking using

@@datadir 

its showing old path

MariaDB [(none)]> select @@datadir;
+-----------------+
| @@datadir       |
+-----------------+
| /var/lib/mysql/ |
+-----------------+

Please help me to solve this

0

There are 0 answers