Jump to content

Archived

This topic is now archived and is closed to further replies.

jeffblochjr

Problem with huge database

Recommended Posts

I am trying to move a mysql database from a site on one server to a new site on a different server. I dumped the old site\'s structure and imported it into a new mysql database on the new web site... but there is 700 meg of data on the old database. 26 text files make up the bulk of this 700 meg, and they must be uploaded to 26 tables on this new mysql database on the new server. When I try to do this via phpMyAdmin, it freezes up on me because it takes so long (I\'m even using a cable internet connection!). What are my other options for uploading the data of these tables? I have to get this information into the new database, but it always times out. Please help! Thanks.

 

Jeff

Share this post


Link to post
Share on other sites

jeff, can you do the backup at the command line interface?

Share this post


Link to post
Share on other sites

My problem is... I have the whole structure of the database all worked out and transferred over. Now I need to move the 700+ meg of data from the old database to the new. I have these 26 data files (text documents) on my hard drive, and I click on \"Insert data from a textfile into table\" for the respective table. Then, I direct it to look at the text file on my hard drive, and click Submit. Then I wait about 3 or 4 minutes... and the page basically reloads itself. No confirmation or error messages... it just reloads and stops reading the file. That\'s it. How else can I get the data from these text files into the tables? Please help, I am stumped.

Share this post


Link to post
Share on other sites

I\'m affraid I don\'t know much about mysql or writing scripts... and unfortunately I wouldn\'t know the first thing about writing a script to perform that action. There is no other way to simply upload this textual data into the mysql database? I mean, why isn\'t it working when I tell it to \"Insert data from a textfile into table\"??

Share this post


Link to post
Share on other sites

That\'s gotta be it!! How can I change that value? I just have to get these text files into my database. Is there any way to disable this upload limitation?

Share this post


Link to post
Share on other sites

If I can get into shell, and I have these huge text files already uploaded to my website... is there a command I can use to import these files into my MySQL database tables?

Share this post


Link to post
Share on other sites

the upload limit is changed in the php.ini file at this line:

upload_max_filesize

 

if you can get to the command line you can backup everything from there by using the mysql binary.

Share this post


Link to post
Share on other sites

As it turns out, I dont have access to edit php.ini, and my web host couldn\'t help me much with it. I did, however, get this whole big problem to solve itself with a simple \"LOAD DATA INFILE...\" command (after uploading these incredible huge text files onto my web site), and it worked like a charm. Thanks for all the help you guys have given me.

Share this post


Link to post
Share on other sites

Here\'s yet another problem... everything was going fine, but then I hit a certain file and I did this command as usual:

 

LOAD DATA INFILE \'/var/www/html/data/records_t.txt\' INTO TABLE records_t FIELDS TERMINATED BY \';\' ENCLOSED BY \'\"\' LINES TERMINATED BY \"n\";

 

However, this time for some reason, I get the following message:

 

Error



SQL-query :  



LOAD DATA INFILE \'/var/www/html/data/records_t.txt\' INTO TABLE records_t FIELDS TERMINATED BY \';\' ENCLOSED BY \'"\' LINES TERMINATED BY "n" 



MySQL said: 



Got error 122 from table handler

 

What should I do? How can these tables be corrupt? I just exported the structure from another database and uploaded it to this one. Please help!

Share this post


Link to post
Share on other sites

When I do a check on these \"corrupted\" tables, I get these messages:

 


Table is marked as crashed and last repair failed

Size of datafile is: 14008320       Should be: 0

Can\'t read indexpage from filepos: 147456

Corrupt

 

Any suggestions?

Share this post


Link to post
Share on other sites

guess I arrived too late..... :!:

 

here\'s something for the huge mysql backups that can easily be done using your webbrowser.

 

copy this coding and call it dump.php

 

<?php

include (\"YourConfigFile.php\");

$output=system(\"mysqldump -u \".$db_user.\" -p\".$db_pass.\" \".$db_dbname.\" --opt > NameOfFilebackup.sql\");

header(\"Location: NameOfFilebackup.sql\")

?>

 

create a blank file: NameOfFilebackup.sql

chmod it to 777

change to your specs: $db_user, $db_pass, $db_dbname

 

call dump.php in your browser and when it is complete you will have

your table/data imported into the file NameOfFilebackup.sql

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.