SLUG Mailing List Archives
Re: [SLUG] Transferring MySQL Data between drives !!
- To: "Louis Selvon" <lselvon@xxxxxxx>, <slug@xxxxxxxxxxx>
- Subject: Re: [SLUG] Transferring MySQL Data between drives !!
- From: "Oscar Plameras" <oscarp@xxxxxxxxxxx>
- Date: Tue, 20 May 2003 07:11:55 +1000
From: "Louis Selvon"
Sent: Monday, May 19, 2003 10:54 PM
> To fix the problem a fresh restore was required by the support staff on a
> They have mounted my original drive with all the data on a slave drive.
> I have never transferred MySQL data between drives. Can anyone tell me how
> go about this, or point me to some url that may help on this ?
Depending on whether you are MySQL user or DB Administrator.
As user, there is a file called '.my.cnf' in your home directory.
1. Look for a line that says '[mysqld]'.
2. One of the lines that follows this line starts with 'datadir = .......'.
datadir = /var/mysql
Change this line to point to the new directory, for example
datadir = /usr/local/mysql
assuming this is the new directory.
Stop/Restart your mysql application.
As DB Administrator, look for global 'my.cnf' usually in '/etc/'.
Change the 'datadir = ...' parametner accordingly and advise all
your users to examine if they have their own local 'my.cnf' and
In your 'my.conf' you may have to change your log files, too.
Ensure your file permissions in your new directory is
readeable and writable by the owner of your databases,
Stop/Restart your mysql daemon.
Then, RTFM (Read the fine manual) documentation found at www.mysql.com.