dbTalk Databases Forums  

using mysqldump data for mysqld --bootstrap

comp.databases.mysql comp.databases.mysql


Discuss using mysqldump data for mysqld --bootstrap in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mark Huizer
 
Posts: n/a

Default using mysqldump data for mysqld --bootstrap - 03-05-2010 , 07:02 AM






When moving data from machine 1 to machine 2, I tried to script the
moving of mysql data, basically in pseudocodish:

foreach db
mysqldump the database
move file to new machine
cat dumpfile | mysqld --bootstrap --datadir=$DDIR
end

This fails at first, since mysqld --bootstrap can't deal with linebreaks
in statements, so the CREATE TABLE .... fails, as it is distributed over
multiple lines.

A little scripting to remove the newlines, and now the script works as
planned, but is this intentional behaviour? Shouldn't mysqld accept the
mysqldump files?

(Next step could be to check if I can get the stuff working for stored
procedures, but given that there are only 3, I decided to just do that
manually)

Mark

Reply With Quote
  #2  
Old   
Axel Schwenke
 
Posts: n/a

Default Re: using mysqldump data for mysqld --bootstrap - 03-05-2010 , 09:39 AM






Mark Huizer <xaa+news_comp.databases.mysql (AT) dohd (DOT) org> wrote:
Quote:
When moving data from machine 1 to machine 2, I tried to script the
moving of mysql data, basically in pseudocodish:

foreach db
mysqldump the database
move file to new machine
cat dumpfile | mysqld --bootstrap --datadir=$DDIR
end
LOL

Quote:
Shouldn't mysqld accept the mysqldump files?
Nope. The --bootstrap mode is not meant to be used for normal work,
only to bootstrap (sic!) the MySQL server when the system database
(`mysql`) has not yet been created.

Once the `mysql` database is created, the server can be started
normally and the dumps be loaded with the command line client:

foreach db
mysqldump the database
move file to new machine
cat dumpfile | mysql -u root -p
end

And of course you could also shutdown MySQL on the old machine,
copy the datadir to the new machine and then start MySQL there.


XL

Reply With Quote
  #3  
Old   
Mark Huizer
 
Posts: n/a

Default Re: using mysqldump data for mysqld --bootstrap - 03-05-2010 , 10:24 AM



The wise Axel Schwenke enlightened me with:
Quote:
Shouldn't mysqld accept the mysqldump files?

Nope. The --bootstrap mode is not meant to be used for normal work,
only to bootstrap (sic!) the MySQL server when the system database
(`mysql`) has not yet been created.
Well, actually, I'm bootstrapping it since the server is not running
when I want to put the data in :-)

I know that the normal way would be either to copy the database file, or
use mysql to import the dumps.
The reason I'm doing it this way is this: the mysql server is not
running at the time of filling it with data.

The point remains though for the mysql db that you cannot dump and then
feed to mysqld --bootstrap, due to the create table being split over
multiple lines.

Anyway, for my case it's not really that important. I have it working
and it's just a one time action. I was just wondering whether this
should be possible.

Mark

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.