If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > doubt: mysqldump in linux like windows

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-20-08, 14:43
dr_pompeii dr_pompeii is offline
Registered User
 
Join Date: Jan 2008
Posts: 22
doubt: mysqldump in linux like windows

Hello guys

i have this situation
in widnows with the mysql administrador i make backup
i saw in the x.sql these lines for example

Code:
/*!40000 ALTER TABLE `articulo` DISABLE KEYS */;
INSERT INTO `articulo` (`idArticulo`,`descripcion`,`stockactual`,`precioUnitario`,`precioUnitarioVenta`,`totalValorizado`,`xtraTextUnoArticulo`,`xtraNumDosArticulo`,`idLineaCategoria`,`idMedida`) VALUES 
 ('00001-15W40','ACEITE EXTRAVIDA X GLN 15W40','0.00','0.00','0.00','0.00','','0.00','300','11'),
 ('00001-CHA01','KIT CHACARERO AZUL (GDFGO,PORTAF,LLANT-DEL/POST)','0.00','0.00','0.00','0.00','','0.00','300','14'),
 ('00001-P0001','CASCOS DE MOTOS HONDA','0.00','0.00','0.00','0.00','','0.00','300','10'),
 ('00001-P0003','LLANTAS DUNLOP LT 265/75R216','0.00','0.00','0.00','0.00','','0.00','300','10'),
 ('00001-P0014','POLOS HONDA','0.00','0.00','0.00','0.00','','0.00','300','10'),
see pls that each row is written in a unique of line of text

now in linux with command in a terminal i do in this way my backups

Code:
mysqldump --opt --password=XXX --user=root somedb > /home/Someuser/somepath/A.sql
the backup is done but in this way
Code:
/*!40000 ALTER TABLE `articulo` DISABLE KEYS */;
INSERT INTO `articulo` VALUES ('00001-15W40','ACEITE EXTRAVIDA X GLN 15W40','0.00','0.00','0.00','0.00','','0.00','300','11'),('00001-CHA01','KIT CHACARERO AZUL (GDFGO,PORTAF,LLANT-DEL/POST)','0.00','0.00','0.00','0.00','','0.00','300','14'),('00001-P0001','CASCOS DE
how you can see, all the rows appear in one line,
dangeous, i dont want this behaviour when i open this file in windows tell
me if i try to save this file i will missing some values or rows
and in linux the gedit dies

after to read this
http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html
i tried in this way
Code:
mysqldump --opt --extended-insert--password=XXX --user=root somedb > /home/Someuser/somepath/A.sql
with the same undesired results

how i can resolve this??

thanks in advanced
Reply With Quote
  #2 (permalink)  
Old 03-23-08, 12:00
digioz digioz is offline
Registered User
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 34
On Windows, in MySQL Administrator, click on the Advanced Options Tab under Backup. I recommend that you check "Compatibility mode" and uncheck "Complete INSERTs" and "Comment".

If that doesn't do it for you, you can always use MSDOS command line to do mysqldump on Windows. This should give you the same results as on Linux.

Pete
__________________
DigiOz Multimedia
http://www.digioz.com
Reply With Quote
  #3 (permalink)  
Old 03-23-08, 16:49
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,609
I'd use the
Code:
mysqldemp --lines-terminated-by=\n,
with whatever other options seemed appropriate.

-PatP
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On