+ Post New Thread
Results 1 to 11 of 11
How do you do....it? Thread, Automate a Database Export to a schedule in Technical; With Xampp is it possible to automatically export a database account to a schedule? Thanks Z...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,212
    Thank Post
    893
    Thanked 1,773 Times in 1,529 Posts
    Blog Entries
    12
    Rep Power
    461

    Automate a Database Export to a schedule

    With Xampp is it possible to automatically export a database account to a schedule?

    Thanks

    Z

  2. #2

    Edu-IT's Avatar
    Join Date
    Nov 2007
    Posts
    7,250
    Thank Post
    404
    Thanked 630 Times in 575 Posts
    Rep Power
    185
    I'm probably being thick but can you explain exactly what it is you're trying to do?

  3. #3

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,212
    Thank Post
    893
    Thanked 1,773 Times in 1,529 Posts
    Blog Entries
    12
    Rep Power
    461
    Create Backups of the databases, If I schedule to export databases to a folder then get the backup software to backup that software.

  4. #4
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,993
    Thank Post
    120
    Thanked 286 Times in 263 Posts
    Rep Power
    107
    batch file or something.
    Stop service
    sqldump or equivalent
    start service

  5. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,212
    Thank Post
    893
    Thanked 1,773 Times in 1,529 Posts
    Blog Entries
    12
    Rep Power
    461
    HI, someone posted some commands to achieve this. They also stated not to stop the database. I think it was Jona but not 100%. Them posts have been lost because of the server going down.

    Please can you post them again

    Thanks

  6. #6
    Jona's Avatar
    Join Date
    May 2007
    Location
    Cranleigh
    Posts
    471
    Thank Post
    14
    Thanked 51 Times in 49 Posts
    Rep Power
    24
    Hi,
    Yeh it was me. We back up our mysql server (moodle) nightly and don't stop it, if fact if you do stop it as in kill the service you can't connect at all (fairly obviously) so I don't think you need to do this.

    The command is as follows:
    mysqldump -u mysqlUsername --password=mysqlPassword databaseName > c:\locationYouWantToSave\TheDatabase.sql

    If your path environment isn't set up correctly you may need to search for mysqldump on your hard disk and run it from there.

    Hope that helps.

    Cheers
    Jona

  7. Thanks to Jona from:

    FN-GM (11th July 2008)

  8. #7

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,212
    Thank Post
    893
    Thanked 1,773 Times in 1,529 Posts
    Blog Entries
    12
    Rep Power
    461
    Hiya, thanks for that works a treat

    Another question, do you know the command to export all databases?

    Thanks

    Z

  9. #8
    Jona's Avatar
    Join Date
    May 2007
    Location
    Cranleigh
    Posts
    471
    Thank Post
    14
    Thanked 51 Times in 49 Posts
    Rep Power
    24
    No worries, according to mysql you should be able to use mysqldump --all-databases.

    See: MySQL :: MySQL 5.0 Reference Manual :: 4.5.4 mysqldump — A Database Backup Program

    Cheers
    Jona

  10. #9

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,212
    Thank Post
    893
    Thanked 1,773 Times in 1,529 Posts
    Blog Entries
    12
    Rep Power
    461
    Hi

    when i try to import a database that has been exported using the command i get the attached error message.

    If works fine if i do it manually.

    Any ideas please?

    Thanks

    Z
    Attached Images Attached Images

  11. #10
    Jona's Avatar
    Join Date
    May 2007
    Location
    Cranleigh
    Posts
    471
    Thank Post
    14
    Thanked 51 Times in 49 Posts
    Rep Power
    24
    Are you using the --all-databases when exporting? If you aren't then you need to have a database selected before you try and import it, you could create a new test database for this purpose.

    When I do an import I ignore phpmyadmin and just do it directly from the command line using something like:
    Code:
    mysql -h loclahost -P 3306 -u root --password=rootpassword testdb < c:\database\database.sql
    Guide here: How to Back Up and Restore a MySQL Database

    Cheers
    Jona

  12. #11

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,212
    Thank Post
    893
    Thanked 1,773 Times in 1,529 Posts
    Blog Entries
    12
    Rep Power
    461
    I am using this one

    mysqldump -u mysqlUsername --password=mysqlPassword databaseName > c:\locationYouWantToSave\TheDatabase.sql
    I will try that tomorrow and let you know how i get on.

    Cheers

    Z

SHARE:
+ Post New Thread

Similar Threads

  1. Maintainece Schedule
    By FN-GM in forum Wiki Announcements
    Replies: 2
    Last Post: 26th March 2008, 11:40 PM
  2. Maintainece Schedule
    By Neville in forum Windows
    Replies: 18
    Last Post: 24th March 2008, 07:33 PM
  3. Replies: 1
    Last Post: 25th September 2007, 07:34 PM
  4. Replies: 4
    Last Post: 28th February 2007, 09:37 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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