how to make Max upload size bigger?

Discussion in 'MySQL' started by lapidus, Aug 1, 2012.

  1. #1
    Hi,

    I have a VPS that currently allow uploading 2MB max sql file to MySQL. Because I'm trying to import a 40MB-sql file into my database, I am wondering how to make MySQL Max upload size bigger?
    I know that i must find php.ini file and Edit variables:

    memory_limit
    post_max_size

    How to do that?
     
    lapidus, Aug 1, 2012 IP
  2. korfezli1966

    korfezli1966 Well-Known Member

    Messages:
    289
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    165
    Digital Goods:
    1
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    What's the error you are getting? MySQL has a file size limit that is set in my.cnf as well.
     
    jestep, Aug 2, 2012 IP
  4. writingwhiz

    writingwhiz Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    PHP specifies its own max upload size in PHP.ini.

    Have you taken a look in there to see what your PHP upload limit is? Head over to the root of your server and see where PHP is installed. Then look for PHP.ini

    Or, do you have cPanel or another web server management console?
     
    writingwhiz, Aug 4, 2012 IP
  5. lorrian

    lorrian Banned

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #5
    You can set the file size in the php.ini file by defaults its 2mb you can change it as per your need and when you are on the server you can even modify it in .htaccess file
     
    lorrian, Aug 13, 2012 IP
  6. xidan

    xidan Member

    Messages:
    71
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #6
    It depends on the settings in php file, i would say you can set the file size in the php.ini file so that bigger file can be uploaded using php
     
    xidan, Aug 22, 2012 IP
  7. lapidus

    lapidus Well-Known Member

    Messages:
    396
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    128
    #7
    Yes xidan but i can't find php.ini via SSH.
     
    lapidus, Sep 6, 2012 IP
  8. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #8
    Use an htaccess file to set it. You can also set it in a php file using ini_set but some web hosts block this function as it can be a major security risk.
     
    jestep, Sep 6, 2012 IP
  9. dollarfish

    dollarfish Member

    Messages:
    89
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    26
    #9
    Edit your php.ini and set bigger size
     
    dollarfish, Sep 13, 2012 IP