Database too big to import
Posted by: Lefty (---.citykom.de)
Date: September 05, 2009 11:00PM

Hi guys,

im a newbie to setting up and running webservers (including SQL, PHP etc.) and already got some big problems.

Im running the latest Wampserver with all of the latest stuff (PHP, MySQL, Apache).
When i try to import our websites DB, it wont work as the filesize seems to be too big.

I already changed the php.ini to allow bigger filesizes to be uploaded also memory usage.
Now with Gzip it works but only imports 20 tables but we have plenty more.

Without compression or Zip it takes minutes, spits out an error message tho and only imports 3/4 of our DB.

Then read about the bigdump.php script to import bigger SQL dumpfiles but it fails also as my Appache then crashes.

Does anyone of you have a good hint on how i could still import our DB?

Thx

Options: ReplyQuote
Re: Database too big to import
Posted by: toumimi (84.6.111.---)
Date: September 06, 2009 11:26AM

Quote

Then read about the bigdump.php script to import bigger SQL dumpfiles but it fails also as my Appache then crashes.

Probably, you're using php5.3 and function mysql_close in it does not have an argument.

Here is an example of how to use function mysql_close with an argument.
$link = mysql_connect("localhost",$username,$password); 
if (!$link) {
   // Could not connect mysql database
}
mysql_close($link);

Then you would be able to use bigdump.php file.

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote
Re: Database too big to import
Posted by: Lefty (---.versanet.de)
Date: September 06, 2009 06:29PM

Ok thx already but im still a noobie with DBs and PHP ;-)
Where do i have to put in this code?

Options: ReplyQuote
Re: Database too big to import
Posted by: toumimi (84.6.111.---)
Date: September 06, 2009 08:51PM

I don't know which script file you get, so I suggest you to download archive here : [www.ozerov.de]
Then replace "mysql_close()" by "mysql_close($dbconnection)" line 784.

Good luck winking smiley

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote
Re: Database too big to import
Posted by: Lefty (---.versanet.de)
Date: September 06, 2009 10:23PM

Ok the script works now but still i cant import the DB.
So i create the DB test, that i would like to import actually.

Then i run the bigdump.php <<<< works so far.
Then i can upload the database dumpfile test.sql <<<< works so far
Then i can import the dumpfile into the test DB or delete it, i choose import and get this error


Error at the line 12: CREATE DATABASE `test` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

Query: CREATE DATABASE `test` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

MySQL: Can't create database 'test'; database exists





1. the DB is encoded as latin1_swedish_ci already when i download it fom the webserver:
i see the all tables are encoded with that.

2. Can't create database 'test'; database exists.........so i need to creat this DB first in order to import it but when i do it wants to create the DB that already exists and this wont work of course.

What can i do now?

Options: ReplyQuote
Re: Database too big to import
Posted by: toumimi (84.6.111.---)
Date: September 09, 2009 05:49AM

I don't use BigDump because I don't have so big databases, but if there is an sql file exported, you can modify it to don't create database, or better, add a tag "if not exists" (mysql create database).

Florian

WampServer Patch (Screenshots)
Topic EN : www.wampserver.com
Topic FR : www.wampserver.com

Options: ReplyQuote
Re: Database too big to import
Posted by: Lefty (---.versanet.de)
Date: September 09, 2009 04:43PM

Unfortunately our DB is very big so i have to use the bigdump.php
Or do you know another method for me to impot big DBs?

Well i dont know where to put this tag.
I read about this command CREATE DATABSE IF NOT EXISTS test;

So i deleted this command from the SQL dumpfile AND the bigdum.php (only CREATE DATABSE) but its anyway commented.

So where do i have to put this tag and where else can i find this command as it seems to create the DB although it seems to be existing nowhere else?

Options: ReplyQuote
Re: Database too big to import
Posted by: hi_tech_guy_18 (---.114-84-212.staticip.namesco.net)
Date: September 09, 2009 07:42PM

Use the community ver of SQLyog [Free] to import the .sql file
[code.google.com]

It can Import a Huge +600MB SQL Dumps Database into to WAMP Server with no problems!
SQLyog has a neat automatic function where it will do large dumps in smaller sections that the mysql server can deal with. All it does is brake the big .sql dump into smaller fragments and sent each fragment to mysql to rebuild it

It can be a 4kb db or a 4GB Database SQLYog will mange successfully to import them into mysql regardless of how strict the my.ini file is

Options: ReplyQuote
Re: Database too big to import
Posted by: Lefty (---.versanet.de)
Date: September 09, 2009 11:56PM

Hey man, thx for this good hint.
Solved my problem with the DB import.

Thx again smiling smiley

Options: ReplyQuote


Sorry, only registered users may post in this forum.