phpmyadmin php.ini

Hi guys,

the problem is I need to import an sql dump into phpmyadmin so I can

populate my fresh database with the contents of a previous one.

But the file upload size setting in Linode is too small. As I understand it, the change needs to be made in phpmyadmins php.ini ??

Can someone tell me if that is right, where I find this file and what I edit … please ?

9 Replies

That depends on what distro you installed, the file is somewhere in /etc assuming you installed the distro's packages for php instead of source. Go to /etc and do a find for php.ini.

@jax:

That depends on what distro you installed, the file is somewhere in /etc assuming you installed the distro's packages for php instead of source. Go to /etc and do a find for php.ini.

Thanks for responding.

I am working with the Ubuntu 10 distro.

I amended etc/php5/apache2.php.ini and added the following at the very bottom of the file:

php_flag upload_max_filesize 50M
php_flag max_execution_time 300
php_flag memory_limit 64M

I then executed : sudo apache2ctl restart

Upon refreshing and attempting to reload my sql dump, it still timed out.

Phpmyadmin still has a value of Max: 2,048 KB next to the fileupload

You shouldn't be using phpmyadmin to import large SQL datasets, you should be doing it with the mysql commandline tool.

IIRC the syntax was something like:

myfile.sql > mysql -u guspaz -p

Although what other parameters you need (such as database) depend on what's in the script.

@Guspaz:

You shouldn't be using phpmyadmin to import large SQL datasets, you should be doing it with the mysql commandline tool.

IIRC the syntax was something like:

myfile.sql > mysql -u guspaz -p

Although what other parameters you need (such as database) depend on what's in the script.

Ok, I was not aware of that. I'will try that shortly.

Could you tell me if that mysql command is active from a specific directory or just any where?

And perhaps the general syntax of how to upload from my desktop to mysql on my remote server, please.

Thanks

@sisko:

I am working with the Ubuntu 10 distro.

I amended etc/php5/apache2.php.ini and added the following at the very bottom of the file:

php_flag upload_max_filesize 50M
php_flag max_execution_time 300
php_flag memory_limit 64M

Did you look at the rest of that file for the settings? On my Debian Lenny install there is a setting already in /etc/php5/apache2/php.ini :

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
;upload_tmp_dir =

; Maximum allowed size for uploaded files.
upload_max_filesize = 8M

; Maximum number of files that can be uploaded via a single request
max_file_uploads = 50

@Guspaz:

myfile.sql > mysql -u guspaz -p
facepalm

That'll give a "command not found" error and create empty file called mysql. You want to READ the file, and > is "capture the output".

mysql DatabaseNameHere -u UsernameHere -p < filename.sql

It'll prompt for password.

@sisko:

And perhaps the general syntax of how to upload from my desktop to mysql on my remote server, please.

There's a Linode library guide here: http://library.linode.com/networking/file-transfer/

FileZilla allows you to use SFTP with your PuTTY key.

@rsk:

@Guspaz:

myfile.sql > mysql -u guspaz -p
facepalm

That'll give a "command not found" error and create empty file called mysql. You want to READ the file, and > is "capture the output".

mysql DatabaseNameHere -u UsernameHere -p < filename.sql

It'll prompt for password.

Wups. My excuse will be insufficient sleep. I do know the difference ;)

@sisko:

Could you tell me if that mysql command is active from a specific directory or just any where?

You can run that pretty much any where, but you will of course need to specify the source file including it's path unless it is in the directory from which you issue the mysql command.

Have you already created the database to receive the import?

@sisko:

And perhaps the general syntax of how to upload from my desktop to mysql on my remote server, please.

Thanks

If Windows is you usual OS you may want to try WinSCP for your file transfers.

As well as being free (a quick google will get you the download) it can also be used for quick file edits ;)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct