PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > The PowWeb Platform > MySQL
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
 
Thread Tools Search this Thread
Old 1-18-05, 03:51 PM   #1
Shockt
 
Posts: n/a
MySQL database backup problems... result #2?

I am currently using a combination of B&T's scripts. One that runs a cron job every day that calls a PHP script to backup a database. The PHP script works correctly when executed through a browser (sends me an email with the filesize of the backup and the backup is stored in a directory). The cron job also works correctly, executing the PHP script and mailing me the result. Though, the problem I am having is the backup does not complete when executed by the cron job. A file with the name the backup uses is created but nothing is stored in it. Using the following returns $result = 2.

system( "/usr/local/bin/mysqldump --opt --no-create-db --user=$dbuser --password=$dbpswd --host=$host $mysqldb > $filename",$result);

All the variables are correct as the backup works perfectly when executed in a browser.. I am not sure what the cron job is doing to screw it up..
 
Old 1-18-05, 07:08 PM   #2
Shockt
 
Posts: n/a
Still havent found a solution =\
 
Old 1-19-05, 10:56 AM   #3
Shockt
 
Posts: n/a
Did the same thing this morning... anyone having this problem?
 
Old 1-19-05, 12:29 PM   #4
B&T
Just tryin' to help
 
B&T's Avatar
 
Join Date: Jan 2003
Location: along the journey
Posts: 8,036
Reputation: 125
What is in the variable $filename? The problem has to be there. Directory persmissions . . . something. The only thing different about the cron execution is that when you run the script it is running as you. When Cron runs it is not. So permissions are the likely cause the more I think about this.
__________________
Enhance your PowWeb experience @ B&T's Tips & Scripts
Got some free time? You can find Nothing of Value @ PrettyWorthless.com
B&T is offline  
Old 1-19-05, 06:19 PM   #5
Shockt
 
Posts: n/a
$filename="/www/s/shocktnet/htdocs/isigpets_dbbackup/backup_$day.sql";

The location of the directory will most likely change when I get this working properly. I CHMODed the directory to '777' and will let the cron run through it again and see if the problem is fixed. Though I do not think the permissions is what is creating the error as the backup_x.sql is being created but no information is put into it.
 
Old 1-19-05, 07:21 PM   #6
Shockt
 
Posts: n/a
Changing the permissions of the directory to '777' did not work. I am still getting the result = 2.
 
Old 1-19-05, 07:50 PM   #7
B&T
Just tryin' to help
 
B&T's Avatar
 
Join Date: Jan 2003
Location: along the journey
Posts: 8,036
Reputation: 125
777 would not be right anyway. should be 755. OK, I forgot the file is created but empty. I am also still stumped on this one. I will continue to think about it. What is unique to you and cron. Maybe your server? As far as I know you are the only one to have this issue.

I also still cannot find the answer as to what the result code 2 means. Hmmm . . .
__________________
Enhance your PowWeb experience @ B&T's Tips & Scripts
Got some free time? You can find Nothing of Value @ PrettyWorthless.com
B&T is offline  
Old 1-19-05, 08:23 PM   #8
Shockt
 
Posts: n/a
How do I find out which server I am on?
 
Old 1-19-05, 08:29 PM   #9
B&T
Just tryin' to help
 
B&T's Avatar
 
Join Date: Jan 2003
Location: along the journey
Posts: 8,036
Reputation: 125
You can look in OPS or use the domain resolution tool on my Tips & Scripts page.
__________________
Enhance your PowWeb experience @ B&T's Tips & Scripts
Got some free time? You can find Nothing of Value @ PrettyWorthless.com
B&T is offline  
Old 1-19-05, 09:11 PM   #10
Shockt
 
Posts: n/a
I looked thought both OPS and your website and saw nothing on it. Unless it is easily overlooked, I did not see it under any of the tabs.
 
Old 1-19-05, 09:23 PM   #11
alphadesk
 
alphadesk's Avatar
 
Join Date: Dec 2001
Location: Gulfcoast, TX
Posts: 6,911
Reputation: 102
Shockt

You're on ... www16.powweb.com

OPS won't show what server and when load balancing kicks back in it will just show what "cluster" your pages will be served from.
__________________
Thanks,
AlphaDesk

Those who can read and don't are no better off than those who can't. - Sam Clemens
alphadesk is offline  
Old 1-19-05, 09:32 PM   #12
B&T
Just tryin' to help
 
B&T's Avatar
 
Join Date: Jan 2003
Location: along the journey
Posts: 8,036
Reputation: 125
I don't have access to any packages on 16, so I cannot tell you if there is something unique going on there or not.
__________________
Enhance your PowWeb experience @ B&T's Tips & Scripts
Got some free time? You can find Nothing of Value @ PrettyWorthless.com
B&T is offline  
Old 1-19-05, 09:44 PM   #13
Shockt
 
Posts: n/a
Alright. Maybe I will wait in line for the Live Chat again. Thanks for your attempts!
 
Old 1-19-05, 09:55 PM   #14
WATRD
This Space For Rent
 
WATRD's Avatar
 
Join Date: Dec 2004
Location: Duvall, WA
Posts: 352
Reputation: 31
Quote:
Originally Posted by Shockt
Did the same thing this morning... anyone having this problem?

I believe I am seeing the same thing.

I have three scripts, different only in username, password and database. I can run all three manually but when triggered by cron, one works and two fail with the following;

"/usr/local/bin/mysqldump: Got error: 1251: Client does not support authentication protocol requested by server; consider upgrading MySQL client when trying to connect"

The ones that fail run and create a 0k file. The one that runs creates a proper backup file.

All three scripts are in the same directory and are permissioned the same (644)

I have run windiff's of the file and the only differences are as mentioned above. The usernames and passwords are correct, as witnessed by the fact that I can run the scripts manually.

Did you have any luck getting a resolution to your problem?
__________________
-Rob
WATRD is offline  
Old 1-20-05, 07:07 PM   #15
Shockt
 
Posts: n/a
I contacted an employee through LiveChat and he escalated a support ticket I submitted so I will be expecting a response soon.
 
Old 1-20-05, 07:35 PM   #16
WATRD
This Space For Rent
 
WATRD's Avatar
 
Join Date: Dec 2004
Location: Duvall, WA
Posts: 352
Reputation: 31
Excellent. Please post back if you get a resolution. We are debugging the same thing over on this thread; http://forum.powweb.com/showthread.php?t=20022

Just out of curiosity, does your password have characters other than letters and numbers in it?
__________________
-Rob
WATRD is offline  
Old 1-21-05, 01:21 AM   #17
WATRD
This Space For Rent
 
WATRD's Avatar
 
Join Date: Dec 2004
Location: Duvall, WA
Posts: 352
Reputation: 31
Please see this thread;

http://forum.powweb.com/showthread.php?p=268747

We think we have found the problem, an old version of MySQL dump on one of the machines. Details are in the thread and I have opened a ticket with the hope that they will updated the version and the problem will go away
__________________
-Rob
WATRD is offline  
Old 1-21-05, 05:10 PM   #18
Shockt
 
Posts: n/a
Quote:
Originally Posted by WATRD
Just out of curiosity, does your password have characters other than letters and numbers in it?
Nope.. its only numbers and letters.

Hopefully PowWeb will find a solution soon..
 
Old 1-21-05, 05:40 PM   #19
WATRD
This Space For Rent
 
WATRD's Avatar
 
Join Date: Dec 2004
Location: Duvall, WA
Posts: 352
Reputation: 31
As near as I can tell, the solution is for them to update version of MySQLDump on the server to match the newer version on other boxes. My ticket is still open and has changed hands, so hopefully they will update it and we can be done with this.
__________________
-Rob
WATRD is offline  
Old 1-23-05, 01:16 AM   #20
Shockt
 
Posts: n/a
I got a reply saying they had upgraded MySQL or something and fixed the problem.. but after testing the cron again, it still returned the same result.
 
Old 1-23-05, 10:53 AM   #21
WATRD
This Space For Rent
 
WATRD's Avatar
 
Join Date: Dec 2004
Location: Duvall, WA
Posts: 352
Reputation: 31
My ticket remains open.
__________________
-Rob
WATRD is offline  
Old 1-25-05, 03:40 AM   #22
artemide
 
Join Date: Apr 2003
Location: Cyprus
Posts: 54
Reputation: 5
I think I have the same problem. I'm trying to run a restore and it gives me $result = 2. I'm on mysql06. Here's the thread, any help is appreciated:
http://forum.powweb.com/showthread.p...4&goto=newpost
artemide is offline  
Old 1-29-05, 10:30 AM   #23
WATRD
This Space For Rent
 
WATRD's Avatar
 
Join Date: Dec 2004
Location: Duvall, WA
Posts: 352
Reputation: 31
The error I was seeing has been resolved and my backup scripts run without any problems now, both via http:// and via cron.

See the thread at; http://forum.powweb.com/showthread.p...106#post271106 for details.
__________________
-Rob
WATRD is offline  
Old 1-30-05, 01:18 AM   #24
Shockt
 
Posts: n/a
I got an email today from the script I have running with the information I have been looking for so it is working perfectly. Thanks PowWeb!
 
Old 1-30-05, 11:52 AM   #25
cyberCrank
Resident Crank
 
cyberCrank's Avatar
 
Join Date: Jan 2004
Location: Ethereal Bliss
Posts: 340
Reputation: 24
ditto -- some of ours having cron job problems started working again night before last (28th-29th)
cyberCrank is offline  
Old 2-25-05, 10:09 AM   #26
The Linguist
The Wily Linguist
 
Join Date: Mar 2004
Location: Earth
Posts: 413
Reputation: 33
I'm having the same problem getting this script to back up my database. I get error code 2 when using cron. When I called the script in my browser, no message displayed but the database was backeup however the filesize was zero...

How can I resolve this problem?
The Linguist is offline  
Old 2-25-05, 11:48 AM   #27
B&T
Just tryin' to help
 
B&T's Avatar
 
Join Date: Jan 2003
Location: along the journey
Posts: 8,036
Reputation: 125
I see WATRD got to the solution here:
http://forum.powweb.com/showthread.p...106#post271106
look at that post and up a few more from there.

You will need PowWeb to fix this. Maybe you can get more info from WATRD, or his history on getting this resolved. If he does not post here, PM him.
__________________
Enhance your PowWeb experience @ B&T's Tips & Scripts
Got some free time? You can find Nothing of Value @ PrettyWorthless.com
B&T is offline  
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 07:46 PM.


Contents ©PowWeb, Inc. ~ vBulletin, Copyright © 2000-2007 Jelsoft Enterprises Limited.