Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 819099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:15:15+00:00 2026-05-15T02:15:15+00:00

(See my answer below. Leaving this up in case it helps someone else.) What

  • 0

(See my answer below. Leaving this up in case it helps someone else.)

What follows is a series of attempts to dump a query to an outfile on a new FreeBSD box that my site has moved to. The results are the same if I log in as me or if I log in as root. I hope the style isn’t too annoying. I have my comments commented out around the actual code and output.

// try to dump query to my home dir

SELECT pmr.datetime_requested, 
nfo.postal_code 
FROM 
print_mailing_request pmr, 
personal_info nfo 
WHERE  
nfo.person = pmr.person AND 
pmr.datetime_requested >= "2010-01-01 00:00:00"  AND 
(pmr.print_mailing = 31 OR pmr.print_mailing = 30)
ORDER BY pmr.datetime_requested INTO OUTFILE '/usr/home/david/x';

ERROR 1 (HY000): Can't create/write to file '/usr/home/david/x' (Errcode: 2)

// tried creating file first with touch and even chmod 077 file
// but same error each time

// OK, lets try /tmp

SELECT pmr.datetime_requested, 
nfo.postal_code 
FROM 
print_mailing_request pmr, 
personal_info nfo 
WHERE  
nfo.person = pmr.person AND 
pmr.datetime_requested >= "2010-01-01 00:00:00"  AND 
(pmr.print_mailing = 31 OR pmr.print_mailing = 30)
ORDER BY pmr.datetime_requested INTO OUTFILE '/tmp/x';

Query OK, 24654 rows affected (0.78 sec)

// so let’s look at the file

less /tmp/x
/tmp/x: No such file or directory

// Log back into mysql and try same query again

ERROR 1086 (HY000): File '/tmp/x' already exists

ls /tmp
20100325180233.gtg2010.csv      20100330094652.gtg2010.csv
20100325180448.gtg2010.csv      2010_Q1_UNO.csv
20100325181446.gtg2010.csv      4724.csv
20100325181927.gtg2010.csv      aprbUfvxp
20100326003002.gtg2010.csv      dave.txt
20100327003002.gtg2010.csv      etr.xml
20100328003002.gtg2010.csv      mysql.sock
20100329003003.gtg2010.csv

// No file x.

// If I run query with no INTO OUTFILE I see 24000+ rows of

| 2010-04-04 13:27:09 | 33156                |
| 2010-04-04 13:27:10 | 33156                |
| 2010-04-04 13:30:04 | NE38 8SR             |
| 2010-04-04 14:27:03 | 00901                |
| 2010-04-04 14:37:04 | 75001                |
| 2010-04-04 14:53:05 | 78640                |
| 2010-04-04 15:15:03 | 07410                |
| 2010-04-04 15:27:04 | 43235                |

// So I know it isn’t the query…

// Advice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T02:15:15+00:00Added an answer on May 15, 2026 at 2:15 am

    Doh! When I log into mysql on this machine my connection string has an IP address in it. /tmp as far as mysql is concerned is not on the machine I am logged into…

    so I solved problem by using mysql -e eg:

    mysql -h my.db.com -u usrname--password=pass db_name -e 'SELECT foo FROM bar' > /tmp/myfile.txt
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit: I have solved this by myself. See my answer below I have set
UPDATE: This is now resolved, see answer below. On one of my forms (in
EDIT @mootinator has done awesome work with this. See his answer below. Since I
Problem solved: Thanks guys, see my answer below. I have a website running in
Update: Solved, with code I got it working, see my answer below for the
(see my answer below for solution - thanks for the feedback) It's probably something
EDIT: See my working code in the answers below. In brief: I have a
ANSWER: If you ever see these lines and are mistified like I was, here's
This is the third question in the series of zero-size objects and subobjects today.
(see here for the problem I'm trying to solve) How do you get hibernate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.