How to increase the size limit for the sql file that is being imported in myphpadmin

mysql

#1

Hi,

I am trying to set up my site in c9, I am having issues when I try to import my my sql database. I created a database and I am trying to import the tables and data using a sql file, I tried to import using myphpadmin and from terminal, I am getting an error where the system is unable to open the sql file due to its file size ( it is around 10 mb), it looks like the max file upload size is set to 2 mb in php.ini inside ( /etc/php5/apache2/php.ini) . I tried to edit it and increase the max upload size ( upload_max_filesize) and I got a permission denied message. How can I import an sql file where the file size is bigger than current set defaults if I cannot change the ini file ?


#2

You could instead use the terminal in your Cloud9 workspace to import directly in to your MySQL database. Take a look at this Stack Overflow post for information on how to do that.


#3

Hi,

As I mentioned in my initial post, I tried from both places, terminal and from phpmyadmin as well, It gave me an error in terminal when I did something like
mysql> use db_name;
mysql> source backup-file.sql;

I guess the reason was because of the file size too, if you confirm that we can import using the terminal ( using the source command) for files greater than 2 mb ( default setting), I can try again


#4

There is no size limit for files imported to mysql via the command line. You’re using an unaltered version of mysql for Ubuntu, from the official Ubuntu repos, which has no such limits. phpmyadmin has some default limits but that is php configuration that is limiting that as far as I know, but I’ve never tried to restore a database over a web UI. If you have it backed up (presumably using mysqldump) try:

mysql -u USER -p DATABASENAME < backup-file.sql

source is for running scripts, not restoring backups. For questions about mysql/programming/etc that isn’t cloud9 specific, please post to stackoverflow/reddit/etc.