[plug] moving MySQL

Kirk Turner kirk.turner at wagoonline.com
Thu Aug 21 08:26:49 WST 2003


Just did a quick little test, you can change the data directory by
setting datadir=/path/to/my/data/dir in /etc/my.cnf
This means that you can copy the old data directory to your new
partition and then change the datadir, start up mysql again and you'll
be running fine. (Note you need to keep the same permissions and user
data)

If you dont have a my.cnf already then all you need is the following two
lines:
[mysqld]
datadir=/path/to/my/data/dir

Kirk

On Thu, 2003-08-21 at 00:22, Jon Miller wrote:
> It didn't work then and it still doesn't work now.  The error I'm getting is:
> # Starting mysqld daemon with databases from /data/mysql
> 030820 23:48:08  mysqld ended
> I only want to move the database to a different partition not a different server.
> Sorry I wasn't too clear on this issue.
> 
> Jon
> 
> Jon L. Miller, MCNE, CNS
> Director/Sr Systems Consultant
> MMT Networks Pty Ltd
> http://www.mmtnetworks.com.au
> 
> "I don't know the key to success, but the key to failure
>  is trying to please everybody." -Bill Cosby
> 
> 
> 
> >>> devenish at guild.uwa.edu.au 11:11:18 PM 20/08/2003 >>>
> In message <sf44072b.094 at mmtnetworks.com.au>
> on Wed, Aug 20, 2003 at 11:41:22PM +0800, Jon  Miller wrote:
> > We've run out of disk space and would like to move either the entire
> > MySQL system or if possible move the databases.  Can this be done
> > without any difficulties?
> 
> This is funny. You asked this question in March! Here are the answers
> from that time:
> 
> In message <20030302112908.GA3247 at gulag.guild.uwa.edu.au>
> on Sun, Mar 02, 2003 at 07:29:09PM +0800, James Devenish wrote:
> > If you have the same MySQL version on the same hardware, it is
> > possible
> > to simply copy the files over (e.g. it's like making a backup).
> > Otherwise, an export/import process. A quick glance at the docs
> > (RTFM) revealed:
> >
> > http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#mysqldump 
> > http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#mysqlimport 
> > http://www.mysql.com/documentation/mysql/bychapter/manual_Table_types.html#Moving 
> >
> > Anecdotally, these things work as documented.
> 
> In message <00fe01c2e0ae$d3498fa0$0200a8c0 at Goldfinger>
> on Sun, Mar 02, 2003 at 07:26:45PM +0800, Daniel Pearson wrote:
> > If I remember correctly from when I used to use MySQL you could dump
> > to a .sql file, then import it on the new server.. but I could be
> > wrong.
> 
> In message <20030302033105.A21352 at linmagau.org>
> on Sun, Mar 02, 2003 at 03:31:05AM -0800, Kimberly Shelt wrote:
> > try msqldump whatever db.. then ssh it to where it needs to go :)
> > and pipe it in to the new space.. mysql.com has a searchable docs
> > space.. usually pretty helpful :)
> 
> In message <200303021939.26916.derekfountain at yahoo.co.uk>
> on Sun, Mar 02, 2003 at 07:39:26PM +0800, Derek Fountain wrote:
> > MySQL uses the file system to manage its underlying database
> > structure.  Creating a database actually boils down to a simple
> > "mkdir" in the right place, etc. So you can just copy the files over.
> 
> In message
> <Pine.LNX.4.44.0303022029510.13025-100000 at mail.nathanalberti.com>
> on Sun, Mar 02, 2003 at 08:34:05PM +0800, Nathan Alberti wrote:
> > mysqldump [OPTIONS] database [tables]
> > mysqlimport [OPTIONS] database textfile
> 
> 
> 
> 
> 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 232 bytes
Desc: This is a digitally signed message part
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20030821/aee1e564/attachment.pgp>


More information about the plug mailing list