Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. MySQL
  4. How to take Mysql server backup to local machine?

How to take Mysql server backup to local machine?

Scheduled Pinned Locked Moved MySQL
csharpasp-netmysqlsysadmintutorial
4 Posts 3 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kandalu
    wrote on last edited by
    #1

    Hi, I developed a website in asp.net with mysql. I have to take backup of the server data to my local machine. I am new to this concept. Please give me an idea which concept i have to use. Thanks.

    J M 2 Replies Last reply
    0
    • K kandalu

      Hi, I developed a website in asp.net with mysql. I have to take backup of the server data to my local machine. I am new to this concept. Please give me an idea which concept i have to use. Thanks.

      J Offline
      J Offline
      JoseMenendez
      wrote on last edited by
      #2

      you can use the mysqldump.exe utility, it should work like this: mysqldump -hserver -uroot -pmypassword databasename

      Jm www.menendezpoo.com

      K 1 Reply Last reply
      0
      • J JoseMenendez

        you can use the mysqldump.exe utility, it should work like this: mysqldump -hserver -uroot -pmypassword databasename

        Jm www.menendezpoo.com

        K Offline
        K Offline
        kandalu
        wrote on last edited by
        #3

        Hi, Thanks for your reply. I executed the command you have given. But it shows the syntax error. My website is in shared hosting server. I saw in the mysql forum that mysqldump cannot be used in shared hosting. Could you please give me other idea to take backup of the server data? Thanks.

        1 Reply Last reply
        0
        • K kandalu

          Hi, I developed a website in asp.net with mysql. I have to take backup of the server data to my local machine. I am new to this concept. Please give me an idea which concept i have to use. Thanks.

          M Offline
          M Offline
          mike3169
          wrote on last edited by
          #4

          I run a cron job that runs a web based cgi script each night. It backs up my MySQL database to a directory on my server. I then offload that file along with others nightly with another cronjob backup script to tape. Or at the very least you could download the *.sql file that is created by the cgi script each night. Here is the cgi script I use. Save and upload it as YOUR_DB_NAME.cgi to your web server's cgi-bin directory

          #!/bin/sh # uncomment to run as UNIX script. File must be executable.

          Edit this file and put correct string for following items

          MYSQLUSERNAME1&2 MYSQLPASSWORD1&2 mysqlXX1&2 DATABASE_NAME1&2

          Don't forget to set permission of 755 to this script.

          You can do that with WebFTP, SiteTools, most FTP software, other utilities.

          echo # Send text/plain Content-type header.
          exec 2>&1 # Senf error output (stderr) to the browser

          filename=/path/where/you/save/database_file/DATABASE_NAME1.sql # ex.: dbbackup_2006-03-07.sql --add after name for date--> _`date "+%Y-%m-%d"`

          Dump DB

          mysqldump --opt --no-create-db --user=MYSQLUSERNAME1 --password=MYSQLPASSWORD1 --host=localhost DATABASE_NAME1 > $filename
          #echo "Database DATABASE_NAME1 saved in $filename."

          You can actually run that script from your web browser. e.g. http://www.yoursite.com/cgi-bin/YOUR\_DATABASE\_NAME.cgi

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups