Find the answer to your Linux question:
Results 1 to 4 of 4
hi , I am trying for so many months but could not found the answer I want to write the shell script which 1)Finds all the databases in mysql 2)create ...
  1. #1
    Just Joined!
    Join Date
    Aug 2009
    Posts
    15

    backup all tables in mysql

    hi ,


    I am trying for so many months but could not found the answer


    I want to write the shell script which

    1)Finds all the databases in mysql
    2)create the folder who ever is the creater of that database or owner of that database . I think the databse starts with username_ so i think i have to split the database name to get folders name . How to do that?
    2)backs up the databases belonging to that user

  2. #2
    Just Joined! itsbrad212's Avatar
    Join Date
    Nov 2009
    Location
    Chicago
    Posts
    11
    couldn't you just use phpmyadmin? its way eaiser

  3. #3
    Just Joined!
    Join Date
    Aug 2009
    Posts
    15
    i want to set the cron job as root so that it doest it evryday

  4. #4
    Trusted Penguin elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    2,298
    use

    Code:
    mysqldump -u YOUR-USER-NAME -p THE-PASSWORD -B YOUR-DATABASE-NAME > target-file-name
    This will produce an SQL type file which you can then zip for compactness.

    doesn't help with creating the folder though.
    If we hit that bullseye, the rest of the dominoes will fall like a house of cards. Checkmate! (Zapp Brannigan)


    My new blog. It's probably not as good as I think it is.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...