LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-29-2005, 11:49 AM   #1
petenyce
Member
 
Registered: Sep 2005
Posts: 39

Rep: Reputation: 15
Mysql Export


im trying to create a script that outputs my mysql table data to a csv file. Now i cant get it to write a file? is their something wrong with permissions? i have all privilidges, im looged in as root.. Do i need brackets nothing seems to be working. i have full read write priviledges

thanks


test.sh
/usr/bin/mysql -h localhost -u root ehpadmin </usr/etc/referral.sql

referral.sql
select * INTO OUTFILE '/usr/etc/ReferralAuth.txt'
FIELDS Terminated BY ';' Lines Terminated by '\n' from ehpadmin.referral_Authorization
 
Old 09-29-2005, 01:04 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
You say you're logged in as "root". Did you mean on the system as well? Or are you logged in as "root" only in the database?

One possible reason:
You don't have write permissions to the /usr/etc/ directory. Try this:
Code:
select * INTO OUTFILE '/tmp/ReferralAuth.txt'
FIELDS Terminated BY ';' Lines Terminated by '\n' from ehpadmin.referral_Authorization
(normally every Linux use has write permissions to /tmp)

If it still does not work, check this page for possible reasons for "access denied".

Last edited by Hko; 09-29-2005 at 01:06 PM.
 
  


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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 16 12-10-2012 02:34 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM
Export MySQL table into MS Excel spreadsheet dr_sad Programming 1 07-06-2005 12:56 PM
export .xls into a mysql table anyone? h/w Programming 1 03-17-2004 10:36 AM


All times are GMT -5. The time now is 11:23 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration