Discussion: MySQL upload problem
Afficher un message
Vieux 12/09/2007, 02h39   #6
Chris
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] MySQL upload problem

tedd wrote:
> At 4:46 PM +0100 9/11/07, Stut wrote:
>> tedd wrote:
>>> I know that this is not a php question, but all of you are so smart I
>>> thought would ask anyway.
>>>
>>> I need to upload a 5 Meg sql file to a client's database. However,
>>> his site's phpMyAdmin shows a maximum file size limit of 2 Meg.
>>>
>>> Now, is this something that is controlled by his host, or is there a
>>> way for me to get around it without requiring his host to do
>>> something, or what? How can I do this?

>>
>> Manually break the SQL file into several pieces. You may need to
>> duplicate some statements at the top and tail of the main file in each
>> part and also make sure that you duplicate any USE DATABASE statements
>> to ensure you're on the right DB.
>>
>> You'll also need to make sure you execute them on the server in order.
>>
>> -Stut

>
> -Stut:
>
> This is a relational dB and the several times that I have attempted to
> load it in "in parts" has met with failure.
>
> I was thinking that I could ftp the sql file to the clients server and
> then run a php script on his server, something like:
>
> $sql = "mysql -h$dbhost -u$dbuser -p$dbpass $dbname < $filename";
> system($sql);
>
> But, that didn't work -- however -- using mysqldump did download the
> file. So, I'm close.


Actually reading the php site:

http://php.net/system

With safe mode enabled, the command string is escaped with escapeshellcmd().

Then http://www.php.net/manual/en/functio...eshellcmd.php:

Following characters are preceded by a backslash: #&;`|*?~<>^()[]{}$\,
\x0A and \xFF.

So your < is being replaced with \< which is why it wouldn't work.

--
Postgresql & php tutorials
http://www.designmagick.com/
  Réponse avec citation
 
Page generated in 0,06419 seconds with 9 queries