954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Backing up a MySQL database

Certain graphical elements in this forum (such as user's avatars and file attachments) are actually stored in the database instead of in the file system. Is there a way to back these up along with the database? For example, when I make an sql dump file, it obviously doesn't export these elements.

cscgal
The Queen of DaniWeb
Administrator
19,437 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 
evilmonkey29
Junior Poster in Training
71 posts since Aug 2002
Reputation Points: 11
Solved Threads: 3
 

mysqldump? you know, vBulletin has an integrated backup system that automatically backs up attachements and images. Also, why not use phpMyAdmin? I use it and find it tons helpful in backing things up (although I prefer using vBulletin's method better)

MGM out

MGM
Light Poster
27 posts since Dec 2003
Reputation Points: 10
Solved Threads: 0
 

I've since got it to work via mysqldump. I've found that phpMyAdmin isn't very reliable and often times out when dumping a large database. In addition, I needed a cli command because I wanted to make it into a cron job ;) for automatic nightly database back-up.

Thanks for your help :)

cscgal
The Queen of DaniWeb
Administrator
19,437 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 

i wouldnt suggest using vb's mysql dump feature either


ive used the ssh mysql dumb quite a fewq times just fine

mysqldump --opt -uUSERNAME -pPASSWORD databasname > /path/to/dump.sql

i honestly never had a problem with it


vb also has a specific table backup if you backup the full DB, anything store in the DB will be backuped as well

Zachery
The Geek Father
Team Colleague
894 posts since Nov 2003
Reputation Points: 96
Solved Threads: 21
 

Faranth, I use the same command as you without the --opt - what does that do?

cscgal
The Queen of DaniWeb
Administrator
19,437 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 

yes, in testing my forums on my private server, ive used ssh and ran a command like that, and what cscgal said, whats --opt????

MGM out

MGM
Light Poster
27 posts since Dec 2003
Reputation Points: 10
Solved Threads: 0
 

RTFM ;-) From the man page linked above:

--opt Same as --add-drop-table --add-locks --all
--extended-insert --quick --lock-tables

Tekmaven
Software Architect
Moderator
1,274 posts since Feb 2002
Reputation Points: 322
Solved Threads: 28
 

vb3 lets you store the attachments and avatars on the file system rather then database system. You might want to look into this :)

floris
Junior Poster
162 posts since Jan 2004
Reputation Points: 115
Solved Threads: 2
 
Certain graphical elements in this forum (such as user's avatars and file attachments) are actually stored in the database instead of in the file system.


In any case, I was able to get the problem fixed now. I was having a hard time saving binary representing the graphics, etc into the mysql dump. All fixed :) Sorry for not notifying everyone. I forgot all about this thread.

cscgal
The Queen of DaniWeb
Administrator
19,437 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
 

Then come again, you can easily do it through your CPanel if your running 1. Itlll backup your entire disk including files. Easy to use for export and import I shld say, butthtsanother catigory. Or is it?

mikeSQL
Junior Poster
196 posts since Dec 2004
Reputation Points: 16
Solved Threads: 3
 

This is a very old thread, no point in replying 11 months later :(

Gary King
PHP/vBulletin Guru
Team Colleague
417 posts since Nov 2003
Reputation Points: 53
Solved Threads: 5
 
This is a very old thread, no point in replying 11 months later :(

I will reply because someone will have the same problem.

I use a program called MySqlMaestro, it can backup data or structure or both. It is way better than phpmyadmin and you will shoot yourself not knowing it existed. It is very good, man I should be an affiliate.

Here is the link; visual MySql database administration tool

igotdreams
Newbie Poster
18 posts since Jan 2005
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You