Zen Cart Logo
Forums / Upgrading from 1.3.x to 1.3.9 / How do I save the database without phpmyadmin?

How do I save the database without phpmyadmin?

Locked

Views: 2,217

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
21 Feb 2007, 12:54 AM
#1
rstrange avatar

rstrange

New Zenner

Join Date:
Feb 2007
Posts:
2
Plugin Contributions:
0

How do I save the database without phpmyadmin?

Hi,

Our server provider doesn't currently support phpmyadmin (it's coming but just not yet), and I'm wondering if anyone knows how I can log in to my server via SSH (I know how to do this bit lol) and download our zen database using just the linux command set?

Lol, I can just about navigate and chmod using unix but am still to get to grips with the language - need time to study that I don't have at the moment, but a backup (or several copies) is essential for peace of mind, especially when upgrades come along (my first lol).

Thanks for any help you can send my way.

Regards

Richard

21 Feb 2007, 1:30 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How do I save the database without phpmyadmin?

I am not sure of your capabilities in ssh as this is variable from host to host.

You can try this:

#!/bin/zsh

[ $# -ne 1 ] && { echo “Usage: $0 database”;exit 1 }

db=$1
dbd=”/PATH_TO_YOUR_BUS/$db.$(/bin/date +%a)” # set the path
alias mysqldump=”/usr/bin/mysqldump” # you may need to modify this
alias gzip=”/bin/gzip” # may need to change this too
mysqldump –user=root –password=your_password $db > $dbd # set your password and user

gzip –best –force $dbd

exit 0
21 Feb 2007, 7:22 AM
#3
uncle_unix avatar

uncle_unix

New Zenner

Join Date:
Feb 2007
Location:
Long Beach California
Posts:
31
Plugin Contributions:
0

Re: How do I save the database without phpmyadmin?

rstrange:

Hi,

how I can log in to my server via SSH (I know how to do this bit lol) and download our zen database using just the linux command set?

Richard

Simple, log in and try this, of course put the name of your database & your db password in the correct places.

This little bitty also pipes it to a folder called backup you can create in your home directory and also date stamps it so you know what one it is.

Make a directory in your home folder

 mkdir backups
```
Now do the database backup


```
mysqldump -u root -pyourpassword yourdbname > backups/my-backup-$(date -I).sql
```Now you should have a file called my-backup followed by a date in your newly crested "backup" folder

Thats all I can think of, now off to the adic:cheers:
21 Feb 2007, 7:24 PM
#4
rstrange avatar

rstrange

New Zenner

Join Date:
Feb 2007
Posts:
2
Plugin Contributions:
0

Re: How do I save the database without phpmyadmin?

Thanks for the help Uncle_Unix and Kobra :smile:

I'll give it a whirl

Richard