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 8750645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:54:12+00:00 2026-06-13T12:54:12+00:00

I had created a Django view which is returning some data after reading from

  • 0

I had created a Django view which is returning some data after reading from MySql DB.When i try and fetch around 6000 rows from the Database,everything works fine and the view returns HttpResponse as is expected.However as i try to fetch 7000+ rows i get the following error

(1, "Can't create/write to file '/home/nipun/mysql_temp/MYzplJok' (Errcode: 13)")

Earlier i thought that the error could be due to space getting exhausted for /temp,so i changed the tempdir setting in my.cnf

I also ensured that new tmpdir /home/nipun/mysql_temp and it’s parent directories are writable by me by changing the ownership.
Although this is not a Django problem,here is the view

def query_json(request):
    from django.utils import simplejson
    objects=Publisher.objects.filter(location='ROOM_01',sensor_name='CPU_TEMPERATURE').order_by('-id')[0:9000]

    json = simplejson.dumps( [{"reading": float(o.reading),
                           "timestamp": str(o.timestamp)
                       } for o in objects] )

    return HttpResponse(json,mimetype="application/json")

So in the filter changing 9000 to 6000 works fine.

Some more information about the error is provided in the Django stack trace

errorclass  
<class '_mysql_exceptions.InternalError'>
errorvalue  
InternalError(1, "Can't create/write to file '/home/nipun/mysql_temp/MYuotga9' (Errcode:     13)")
error   
(<class '_mysql_exceptions.InternalError'>,
InternalError(1, "Can't create/write to file '/home/nipun/mysql_temp/MYuotga9' (Errcode: 13)"))

EDIT

As per a comment, i tried this on my MySQL prompt

mysql> CREATE TEMPORARY TABLE t (i int);
ERROR 1005 (HY000): Can't create table 't' (errno: 13)

So it essentially is now an issue of how to allow MySQL to write to temporary directory

  • 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-06-13T12:54:13+00:00Added an answer on June 13, 2026 at 12:54 pm

    It is probably a permission issue for the temporary folder that is used by Mysql.

    You can find the folder used by Mysql for temp operations in the config file in /etc/mysql/my.cnf as such :

    tmpdir          = /tmp
    

    As you can see, the temp folder in use by default is “/tmp”.

    Privileges should be :

    drwxrwxrwt   9 root root  4096 oct.  24 15:39 tmp/
    

    So anybody, including the “mysql” user, can use it.
    If not correctly set, the following command would do the trick :

    chmod 0777 /tmp
    

    Hope this helps !

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I had created one div window which is draggable,and created one child div (with
I had created the following view, SELECT currency_cd, SUM(comprate) AS salary, employee_code, (SELECT SUM(c.comprate)
I created a Django app that had its own internal voting system and a
I was looking if Django had some kind of create_or_get method but it seems
I was merrily developing a web application using the Django development version. After some
I had created a Lib Project with a class inherits ServiceBase but when I
I had created one HTML page for my experiance. In this i had use
I had created a zip file (together with directory) under Windows as follow (Code
i had created a class with two properties one of datetime datatype and other
This is what I want: I had created the top red layout by this

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.