LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-27-2012, 06:48 AM   #1
sanjay87
Member
 
Registered: Oct 2011
Posts: 164

Rep: Reputation: Disabled
How to eliminate "Error 1086 Files already exists " in mysql


Hi

i m trying to run these query in crontab but its delivering error 1086 file already exists when it runs second time,can anyone help me how can i replace the output file

cd /mysql/cron
vi crontab.sql

SELECT * FROM affiliate_supplier INTO OUTFILE '/tmp/affilaite.csv' FIELDS TERMINATED BY ','

mysql affliate -uroot -ppassword < /mysql/cron/crontab.sql


ERROR 1086 (HY000): File 'affilaite.csv' already exists

Last edited by sanjay87; 03-27-2012 at 06:53 AM.
 
Old 03-27-2012, 07:43 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
The docs say there is no way, and that is by design for security. Just delete the file first by some wrapper script.
 
Old 03-28-2012, 03:56 AM   #3
sanjay87
Member
 
Registered: Oct 2011
Posts: 164

Original Poster
Rep: Reputation: Disabled
mysql -udbuser -ppassword dbname -B -e "" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > filename.csv


I think these could help some one
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to eliminate "ISO C++ forbids variable length array" warning? chinho Programming 6 01-28-2011 04:54 AM
Mint 7 How do you eliminate the "joke" in Terminal mode impeteperry Linux Mint 4 07-29-2009 08:01 PM
yum install php-mysql fails with mysql 5.1 - "Error: mysql conflicts with MySQL" rebelde Linux - Software 2 03-13-2009 11:32 AM
"X-MS" cant open because "x-Multimedia System" cant access files at "smb&qu ponchy5 Linux - Networking 0 03-30-2004 12:18 AM
"A duplicate name exists on the network" error with samba colpaarm Linux - Software 0 07-21-2003 03:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration