MYSQL datafile move to diff location
1.Shutdown the mysql server
2.Open the my.ini file found in the
directory where you installed mysql
usually “C:\ProgramFiles\MySQL\MySQL
Server 5.0\my.ini” or "C:\ProgramData\MySQL\MySQL Server 5.5"
3.Find the line ”
datadir="C:/Program Files/MySQL/MySQL Server 5.0/Data/" or
"C:\ProgramData\MySQL\MySQL Server 5.5\data"
4.Comment out the line, by putting a
# sign in front of it.
5.Add a comment to document the
change(date, time, reason).
6.Add a new line with the desired
configuration
datadir="D:/MySQL
Datafiles/data/" or "new Location of datafile"
7.Save the file.
Move/Copy the files to the new
disk/location.
xcopy /D /E /C /V /Y /Z /H /
"C:/Program Files/MySQL/MySQL Server 5.0/Data/" "D:/MySQL
Datafiles/data/" or manualy copy
Start the mysql service.
Moving of my.ini file
Delete the service "sc delete
'service name'"
"location of mysqld"
--install "servicename" --defaults-file="new location
of my.ini file"
eg.
"C:\Program Files\MySQL\MySQL
Server 5.5\bin\mysqld" --in
stall MySQL55
--defaults-file="C:\Program Files\MySQL\MySQL Server 5.5\my.ini