Steps:
1. Stop your mysql server before starting this operation
2. Create the directories that will be new datadir
3. chown the directory to the mysql:mysql user
4. copy the files from the old datadir to the new location (cp -p : preserves ownership). However, make sure that the files
named ib_arch_log_0000000000, ib_logfile0 etc. are not copied to the newer location
5. Make sure that the files and directories are owned by mysql user
6. Make changes in the my.cnf to point the new datadir (datadir = /my/new/dir/)
7. Restart the MySQL database
8. Create a new database and verify that the files for this database are getting created in the new datadir (create database test)
9. After the server is running for a few days properly, get rid of the old data.-e filename
True if filename exists.
-d filename
True if filename exists and is a directory.
-f filename
True if filename exists and is a plain file.
-h filename
True if filename exists and is a symbolic link.
-r filename
True if filename exists and is readable.
-w filename
True if filename exists and is writable.
-n string
True if the length of string is non-zero.
-z string
True if the length of string is zero.
string
True if string is not the empty string.
s1 = s2
True if the strings s1 and s2 are identical.
s1 != s2
True if the strings s1 and s2 are not identical.
n1 -eq n2
True if the numbers n1 and n2 are equal.
n1 -ne n2
True if the numbers n1 and n2 are not equal.
n1 -gt n2
True if the number n1 is greater than n2.
n1 -ge n2
True if the number n1 is greater than or equal to n2.
n1 -lt n2
True if the number n1 is less than n2.
n1 -le n2
True if the number n1 is less than or equal to n2.
! expression
Negates expression, that is, returns true iff expression is false.
expr1 -a expr2
True if both expressions, expr1 and expr2 are true.
expr1 -o expr2
True if either expression, expr1 or expr2 is true.
( expression )
True if expression is true. This allows one to nest expressions.First / Previous / Next / Last / Page 1 of 45 (448 posteets)