Can't import database through phpmyadmin

12,734

Solution 1

Thanks @denys281, that helped me:

chmod -R 777 /var/lib/phpmyadmin/tmp

Solution 2

chown apache-user /var/lib/phpmyadmin/tmp

Replace apache-user with the user configured in /etc/apache2/envvars. Look for these settings:

export APACHE_RUN_USER=apache-user
export APACHE_RUN_GROUP=apache-group

That way you will give permissions for the user running on the web server access to the temp directory, without making it 777 (open to all users).

Share:
12,734

Related videos on Youtube

denys281
Author by

denys281

Updated on September 14, 2022

Comments

  • denys281
    denys281 over 1 year

    When I try upload database (794 kb) I have error:

    No data was received to import. Either no file name was submitted, or the file size exceeded the maximum size permitted by your PHP configuration. See FAQ 1.16.
    

    I have read many answer for this error but I can not find and decision and answers that works for me.

    My server:

    Ubuntu 12.10 Server

    Apache/2.2.22 ( apache2-mpm-itk);

    MySQL client version: 5.5.27;

    phpmyadmin 3.4.11.1deb1;

    nginx/1.2.1;

    PHP 5.4.6;

    Configuration phpmyadmin in /etc/nginx/default

     location /phpmyadmin {
    
                    root /usr/share/phpmyadmin;
                    index index.php;
    
                    proxy_pass http://backend/phpmyadmin;
                    proxy_set_header Host $host;
                    proxy_set_header X-Real-IP $remote_addr;
                    proxy_set_header X-Forwarded-For $remote_addr;
                    proxy_connect_timeout 120;
                    proxy_send_timeout 120;
                    proxy_read_timeout 180;
    
    }
    

    php.ini config

    file_uploads = On
    upload_tmp_dir = /var/tmp
    upload_max_filesize = 128M
    max_file_uploads = 30
    post_max_size = 128M
    

    Thank you!

    • raidenace
      raidenace almost 11 years
      check if your temp folder had write access from php
    • denys281
      denys281 almost 11 years
      @Raidenace I made chmod -R 777 /var/lib/phpmyadmin/tmp/ and all works, but I don't now if it is good practice and if it is secure.
    • raidenace
      raidenace almost 11 years
      @denys281 - Usually tmp folders do have relaxed permissions because they are just transient placeholders of data. Having said that, if you are working in local host that is fine. In server side, the permissions for such directories will be correctly set up by sys admins. Am glad it helped fix your issue..
  • jwinn
    jwinn almost 8 years
    Thank you for this. This fixes the problem if: you've changed your APACHE_RUN_USER to something other than www-data (like I did, to clear up permission + upload issues developing on localhost).
  • Huy Le
    Huy Le over 7 years
    This line of code is gonna be on my note book right now. It saved me a lot of time! Thank you very much!
  • Craig van Tonder
    Craig van Tonder over 7 years
    This creates a security risk because the directory would then be accessible for any PHP script running on the server.