shutdown mysql.
Copy the datafiles from /var/lib/mysql to /database. make sure /database and the files below are owned by mysql.
edit /etc/my.cnf and set datadir=/database
Main Topics
Browse All TopicsHi
I want to move all the databases on my SLES10 server from their default location of
/var/lib/mysql/ to a location of /database/ which is a volume on a seperate array. I have found severla guides, but none of them work and leave me with a none functional MYSQL whcih I then have to reinstall from the product disks to the system default.
If anyone can provide a step-by-step process for SLES10 I would be most grateful
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
OK... i thought simple was best, some of the guides I have are pages long..
Just by adding a datadir statement and restarting MYSQL I have been able (using the command line) interface to move the database to /database/ and verified that a test database is created in this new location.
So far so good. However now, all my webpages are saying that MYSQL is not running or the socket is incorrectly configured. I have tried restarting webservices. However, as you can already assume by the fact I have created a new table, the command line on the server works fine
Do I also have to change the lines in the CNF file for the socket?
I cheated.... so ashamed...
Backed up my MYSQL folder... used software packager to remove all MYSQl components. Reinstalled, editied MY.CNF to the /database/ folder and ran MYSQL as a new user. This created a new MYSQL folder on my /database/ drive. I then stopped MYSQL, renamed the newely created folders to MYSQL_OLD, and restored my backed up one.. restarted MYSQL and boom, MYSQL running perfectly from the new array.
I must assume there is still some pointer in the system that rememebrs where the MYSQL datadir is when referenced by web services..
Ah well.. its working
You should first check whether you can access the databases used in the webpages from the command line.
Did you configure mysql to listen on the TCP port or is your connection socket based?
Relocating the location of the file storage does not alter the functionality of the mysql server.
What might be happening is that the database your webpages try to access has a file ownership issue that prevents mysql from attaching/accessing them.
Business Accounts
Answer for Membership
by: ushastryPosted on 2009-06-22 at 03:46:43ID: 24681102
Try this..
om/2009/06 /relocate- mysqls- dat adir.html
http://ushastry.blogspot.c