Databases go outside your home directory.

Some­one remind me next time I say I’m going to do some­thing stu­pid like rein­stall an oper­at­ing sys­tem too quickly, that data­bases aren’t stored in my home direc­tory. Far out. I’ve just cre­ated hours of work for myself try­ing to piece together what used to be in var­i­ous MySQL data­bases on this com­puter. Yeah, I know, I should backup, but see­ing as I never make major changes (it’s all just incre­men­tal lit­tle stuff for sites still in the devel­op­ment phase) and really don’t under­stand how things are meant to be backed up with MySQL (do you export queries, or do you copy the folder, huh? HUH!??) I don’t any­where near as often as I should.

For me, the data­bases are gen­er­ally ancil­lary things that are merely there to fill in spaces in CSS-based designs, so I always backup design aspects, but rarely the data­base itself, because there’s no orig­i­nal con­tent there. Well, yeah, but there’s vitally impor­tant struc­ture that’s just been thrown away. Doh!

Oh well, noth­ing I can (read: should) do about it now, maybe between tomor­row after­noon and Thurs­day. Think of it as post-humous ITF study. Because that’s all it’s going to get.

Tags:

posted on Sunday, October 16th, 2005 at 3:35 pm by Josh Street, filed under Geek, PHP.

8 Responses to “Databases go outside your home directory.”

  1. dale says:

    I see the data­base as the most import side of a web­site. At least to busi­ness stuff. If the web­site design is lost, that isn’t a *huge* prob­lem. But if client infor­ma­tion is lost that is bad.

    The eas­i­est (and best) way to backup Mysql is through mysqldump:

    mwdmeyer@metro:/home/mwdmeyer> mysql­dump
    Usage: mysql­dump [OPTIONS] data­base [tables]
    OR mysql­dump [OPTIONS] –data­bases [OPTIONS] DB1 [DB2 DB3…]
    OR mysql­dump [OPTIONS] –all-databases [OPTIONS]
    For more options, use mysql­dump –help

  2. Josh says:

    But what I do is mostly markup and CSS. The data­base thing is lim­ited to mak­ing sure TYPES of con­tent dis­play in the cor­rect places, not the con­tent itself. For this site, if I lost the data­base, sure, I’d be annoyed. That’s because I’ve accu­mu­lated nearly 630 posts and just under 1000 com­ments over a period span­ning more than a year. This site is dri­ven by con­tent. (Admit­tedly, I’d be equally irri­tated if I lost files, because there’s a fair amount of non-textual con­tent here, too.)

    I’m famil­iar with mysql­dump, but I find it cum­ber­some… really should setup a shell script for it. I’ll freely admit I wasn’t famil­iar with the –all-databases switch… so that helps, thanks.

  3. Samantha says:

    Some­one remind me next time I say I’m going to do some­thing stu­pid like rein­stall an oper­at­ing system

    … when you should be study­ing? :p

  4. Nicko says:

    Yeah Josh do as your mother says.

  5. Sam says:

    Bzzzzzzzzzzzzzzzzzzzzzz!

  6. Sam says:

    Mmmm, a Joshua smoothie. Just add milk, honey, and your favourite fruits!

Leave a Reply