SunQuest
 
           MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old February 17th, 2004, 10:00 AM
salvelinus salvelinus is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 24 salvelinus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
More mysqldump errors. [Resolved, kind of]

When trying to read back a large dumped file as below, I get fatal error 1064 at line 516383 : Maximum execution time of 300 seconds exceeded.
This is a large file; actually, my boss broke it up into two files because he got a similar error when creating the .sql file.
Code:
mysql test < file_test.sql

Last edited by salvelinus : February 24th, 2004 at 08:55 AM. Reason: Resolved

Reply With Quote
  #2  
Old February 17th, 2004, 12:28 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Looks like you'll need to break it down some more or go into your mysql config and (temporarily) push the execution threshold out to a larger number.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old February 17th, 2004, 01:10 PM
salvelinus salvelinus is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 24 salvelinus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by dhouston
Looks like you'll need to break it down some more or go into your mysql config and (temporarily) push the execution threshold out to a larger number.

Ok, where would I find that? It doesn't appear to be in the my.ini file.
Even with the split I'm not sure it'll work. When I tried importing the second file, I got an error that the table already existed.
Thanks.

Reply With Quote
  #4  
Old February 18th, 2004, 04:03 AM
Summer_Breeze Summer_Breeze is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 Summer_Breeze User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
dhouston and salvelinus...

I have been learning MySQL 4 for 15 days. I'm going to write a little project using Java and MySQL. But the problem I'm currently encountering is "Database Backup". I want to back up the whole database but I'm missing some clues.

mysqldump usage is not very familiar with me. I have tested mysqldump before but I got some errors.
Please let me know how to back up the entire database easily.

Reply With Quote
  #5  
Old February 18th, 2004, 06:43 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Salvelinus, if the table already exists and you've got create table statements in your dump, that's why you're getting the error. Drop your table before trying to slurp in the files, and make sure each section of the file doesn't contain redundant create table statements.

Summer_Breeze, try:

Code:
mysqldump [-u username] [-p] [-h hostname] -A > file.txt


If you're running as root, you can probably omit everything in brackets. The "-A" flag means "dump all databases." And the "> file.txt" redirects the results to the file specified.

Reply With Quote
  #6  
Old February 18th, 2004, 07:46 AM
salvelinus salvelinus is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 24 salvelinus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by dhouston
Salvelinus, if the table already exists and you've got create table statements in your dump, that's why you're getting the error. Drop your table before trying to slurp in the files, and make sure each section of the file doesn't contain redundant create table statements.

I don't have the option of making the files myself, that's done by the boss from the main server. I don't know if he did it correctly. I think the only reason he broke the file is because of the same timeout error when creating it.
How do I go into mysql config to change the execution time?

Reply With Quote
  #7  
Old February 18th, 2004, 08:35 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
I imagine you can change the execution time in the mysql config file (my.ini on Windows, I think). Check out the handy reference at mysql.com for details. Also, you should be able to modify the files your boss output, right? There is syntax you can add to a create table statement that checks first to see if it's already been created (something like "CREATE TABLE blah IF NOT EXISTS" that might help you out. Keep in mind, though, that you'll probably need to dump the table, or at least the data, before running this again. If you don't, you'll probably wind up with duplicate key errors because the values in the first file have already been inserted.

Reply With Quote
  #8  
Old February 18th, 2004, 09:17 AM
salvelinus salvelinus is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 24 salvelinus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks, I'll look into that. I didn't see any execution time in the my.ini file (copy below), but I'll check out mysql.com.
Maybe there's a flag to set to check the table creation. The first file alone is over 10K pages in Word, although most of that's data. Still, there are probably 100+ tables, it would be a pain to code for them all.
Maybe I can just import the structure, w/o the data, then import that separately. Hmmm...
Code:
[mysqld]
basedir=C:/mysql
#bind-address=172.16.1.54
datadir=C:/mysql/data
#language=C:/mysql/share/your language directory
#slow query log#=
#tmpdir#=
#port=3306
#set-variable=key_buffer=16M
[WinMySQLadmin]
Server=C:/mysql/bin/mysqld-nt.exe
user=****
password=*****

Reply With Quote
  #9  
Old February 23rd, 2004, 02:35 PM
salvelinus salvelinus is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 24 salvelinus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Nothing's working. I don't see any setting for maximum execution time, or anything set to 300 seconds. Googling the problem indicates it's a php issue, although why php would be involved at the command line I don't know. No fixes there work either, either in php.ini, or in phpmyadmin (where I did set set_time_limit(0) in read_dump.php).
I've checked for this setting in Windows, in IIS, in PWM as well.

Reply With Quote
  #10  
Old February 24th, 2004, 07:14 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Ah, shoot, that execution time error's a PHP config option, not a mysql option. Check your php.ini file for the "max_execution_time" line and boost that a bit. Make sure you restart apache after changing the value so it'll reload the config.

Reply With Quote
  #11  
Old February 24th, 2004, 07:58 AM
salvelinus salvelinus is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 24 salvelinus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Quote:
Originally Posted by dhouston
Ah, shoot, that execution time error's a PHP config option, not a mysql option. Check your php.ini file for the "max_execution_time" line and boost that a bit. Make sure you restart apache after changing the value so it'll reload the config.

Thanks, but I've done that, increased it to 900 seconds, it still times out at 300 seconds. Using IIS, not Apache. Can I use Apache as my local server if everyone else uses IIS?
I've increased memory_limit, upload_file_size, etc. The only place I've found a limit of 300 seconds is in read_dump.php in phpmyadmin, which I increased to 0 (unlimited), but that didn't work either. I've tried command line and phpmyadmin.
The file is 175 mb, maybe that's just too big. What do big outfits do, though? Some large companies must have gig size dbs.

Reply With Quote
  #12  
Old February 24th, 2004, 08:54 AM
salvelinus salvelinus is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 24 salvelinus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Resolved, sort of.
Never did get rid of the timeout error, but used the data that had imported, then ran the second sql file, and it seems to be ok. Had to drop two tables in between the first and second imports because they were recreated in the second.
Thanks for all your help.

Reply With Quote
  #13  
Old February 24th, 2004, 09:08 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
I don't remember whether or not you were able to try executing the dump at the command line. As PHP's giving you problems, that might be your only option.

You could probably use apache internally, but you'd have to get it to listen on a different port, and I have no idea how you'd even begin to open up another port on Windows.

A 175 mb file would be pretty big to generate in memory from a Web script. To give you a reference point, it took about 20 seconds for me to generate a 20 mb file using the command line tool and redirecting to a file. This is a much easier solution than wrangling with Web timeouts, etc. Your boss needs either to dump the database for you or to give you access to do so. You might also try getting something like mysqlfront or mysqlcc and seeing if they've got utilities that'll do a dump for you.

Reply With Quote
  #14  
Old February 24th, 2004, 09:09 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Oops, that's what I get for multi-tasking and waiting too long to finish my post! Glad you found a solution.

Reply With Quote
  #15  
Old February 24th, 2004, 02:28 PM
salvelinus salvelinus is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 24 salvelinus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks. I did try from the command line, many times.
Command line imported tables till it erred out, so there was some stuff in the db. phpmyadmin didn't import anything when it timed out (assuming it timed out, same time but "page not found" error.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > More mysqldump errors.


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump