Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2007
    Posts
    2
    Plugin Contributions
    0

    Default 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

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default 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:

    Code:
    #!/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
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Feb 2007
    Location
    Long Beach California
    Posts
    31
    Plugin Contributions
    0

    Default Re: How do I save the database without phpmyadmin?

    Quote Originally Posted by rstrange View Post
    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

    Code:
     mkdir backups

    Now do the database backup


    Code:
    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

  4. #4
    Join Date
    Feb 2007
    Posts
    2
    Plugin Contributions
    0

    Default Re: How do I save the database without phpmyadmin?

    Thanks for the help Uncle_Unix and Kobra

    I'll give it a whirl

    Richard

 

 

Similar Threads

  1. v151 Which database is the right one in phpMyAdmin?
    By moonandstars in forum General Questions
    Replies: 9
    Last Post: 7 Aug 2014, 11:33 PM
  2. v139h Save the Multi Table Query Result in phpmyadmin or by SQL CLI
    By explorer1979 in forum General Questions
    Replies: 2
    Last Post: 31 Dec 2013, 09:03 PM
  3. phpMyAdmin for database migration - Wiki or how to?
    By nadsab in forum Upgrading to 1.5.x
    Replies: 5
    Last Post: 13 Mar 2012, 05:02 AM
  4. Backing up the database using phpMYADMIN
    By Sevenhelmets in forum General Questions
    Replies: 4
    Last Post: 2 Feb 2010, 03:28 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR