Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data export/import utility

Status
Not open for further replies.

zyrag

IS-IT--Management
Dec 4, 2002
252
PH
is it possible to export/import data using fix-width and not the csv or tab dilimited format? if not, has anyone had successfully created a utility for it?

thanks,
 
Mysql export , a COMMERCIAL utility to export almost any kind of file




mysqldump, a FREE utility to export a Database dump as sql file


mysqlimport, a FREE utility which comes with MySQL to import any (or almost) txt file into a mysql DB.




I have been happy throughout my life in thinking that samba was I kind of dance; now I live with Linux and all I do is working.
 
i tried to use the statement 'SELECT...INTO OUTFILE' to export data from mysql to a text file and use 'LOAD DATA INFILE' to import data from text file to mysql. I don't have a problem with this for as long as i used the same delimiter when i do the export/import process.
Now, we have an existing database (C-ISAM on AIX 4.2, with Magic Software as the front-end) which i need to import into it the data from mysql. The problem is, the built-in export/import utility from Magic accepts only fix-width format while in contrary, i could not generate an output from the 'SELECT...INTO OUTFILE' statement WITHOUT using a delimiter! Or, is there a way for this that i didn't just discover?
Here's my plan:
1. I'll do the export from mysql using 'SELECT...INTO OUTFILE' using a comma or tab delimiter.
2. Create a utility (in PHP) that would remove the delimiters from the output file created in step1.
3. Import the edited output file from step 2 into our existing database using Magic.

sleipner, i hope you could share to me the algorithm you used or better yet, a sample code snippet in removing the delimiters.

if you have better suggestions, pls share it with me.

thanks,
 
I just used mysqldump. Seems to work great, though I have not tried the restore.

We would rather use select * into outfile....... as the companion to load data local infile. However, while the load data local infile.... works great, there is not a 'local' option for select * into outfile... and I get a permission denied using password (no). Our server is Linux and we are connection using putty from NT. Do I have to move to the server to execute select * into outfile...?

Thanks,.
 
Do you mean that you want to save the file onto another server? If this is the case, you can't use SELECT..INTO OUTFILE, use mysqldump instead or mysql -e "SELECT..."> outfile to generate the file.

SELECT...INTO OUTFILE is mainly intended to let you dump very quickly a table into the host server. Check the manual.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top