Change datadir mysql
If we want to change our datadir mysql, you should follow this steps :
Stopping mysql service
# /etc/init.d/mysqld stop
Move or copy your original datadir directory to your new destination
# mv /old/ /new/
Change ownership of new directory to user and group mysql
# chown -R mysql:mysql /new/
Find your ib_logfile on new directory and delete it
# rm -rf ib_logfile*
Change datadir parameter on my.cnf
# vi /etc/my.cnf
Start your mysql server
# /etc/init.d/mysql.server start