Escaping host limits in PHP
I have bought a new domain and I am moving a board I run to the new host. The new host has a PHP memory allocation limit (memory_limit in php.ini) of 8M and it's giving me headaches. The post_max_size is also 8M. I have no shell access (FTP + phpMyAdmin only, except for http obviously).
I need to recover the database from the old host and it's about 14MB. Uploading this to phpMyAdmin is impossible because of the max_post_size, so I thought I could write a little script to simply use the MySQL dump (14MB on file) as a query. Simple enough, yes. But no, I get slammed by the memory_limit when I read the file, so no go there either. This is an *extremely* cheap host and I guess I get what I pay for. Any ideas how I could solve this? Håkan |
try to upload your dumps with ftp and then load them in your new mysql server with a php script
|
I already tried this and it fails with the memory_limit problem:
Quote:
Håkan |
You can't open the file with fopen() ?
|
No, since the file is larger (14MB) than memory_limit (8MB) the script gets killed for violating the memory limit when I try to read it.
I managed to solve the problem last night after some extensive social engineering (read: kissing ass to an admin) to get a user@"%" entry in MySQL so I could use my local MySQL client to manage the remote server (using source to simply read the dump). Håkan |
I didn't know that opening a 14 MB file will use 14 MB of memory ;)
|
Nope, but reading it into a variable sure will.
Do you have a suggestion on how to parse and execute an SQL dump and get the whole friggen lot into MySQL without actually reading the entire file at a time? I assume one could parse the file and grab the separate CREATE TABLE and INSERT statements one by one...but in a simple (as in quick and dirty and not spending an entire night) way? Håkan |
Generally a mysqldump is a list of mysql insert commands, one by line
PHP Code:
|
All times are GMT -5. The time now is 01:36 AM. |