New server setup

I have 8 gig of innodb database running on redhat 5 machine i want copy mysql directory to another machine and start new server is it possible? Can any one tell exact plan.Thanks in advance.

find out ur mysql directory

mostly this be the dir /var/lib/mysql

all mysql datbase and tables are reside here . just stop the service and tar zip the directory structure.

cd /var/lib/mysql

#tar -zcf /root/Desktop/mysqlold.tar.gz *

copy tar file form desktop to the new server’s data directory and unzip / untar it.

if u want to copy a single database just use # mysqldump

By Larvus

Thanks for your reply.
Do I need to change any permissions to that directories in new server.