exporting & importing database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mirianCalin
    New Member
    • Feb 2008
    • 35

    exporting & importing database

    i am doing the programming at home and our teacher checks it in school that's why i need to export/import my database.. but i dont know how..
    i've found this instruction on the net but i cant understand

    1. Export A MySQL Database
    This example shows you how to export a database. It is a good idea to export your data often as a backup.

    # mysqldump -u username -ppassword database_name > FILE.sql

    Replace username, password and database_name with your MySQL username, password and database name.

    File FILE.sql now holds a backup of your database, download it to your computer.

    2. Import A MySQL Database

    Here, we import a database. Use this to restore data from a backup or to import from another MySQL server.

    Start by uploading the FILE.sql file to the server where you will be running this command.

    # mysql -u username -ppassword database_name < FILE.sql

    Replace the parts in red with your own information.

    This powerful, easy to use command has many uses. Let's say you wanted to switch web hosting providers.

    Simply export your data on the old provider's server and import it on your account with the new host.


    in #1 it says that i have to download "FILE.sql" to my computer.. but the problem is i dont know where will i find "FILE.sql"
  • sandeepsandeep
    New Member
    • Dec 2006
    • 50

    #2
    Give th efull path of the local machine and directory insteed of the File.sql gives the C:\mydata\filen ame.sql

    Comment

    • mirianCalin
      New Member
      • Feb 2008
      • 35

      #3
      Originally posted by sandeepsandeep
      Give th efull path of the local machine and directory insteed of the File.sql gives the C:\mydata\filen ame.sql
      what do you mean by "local machine"? i cant understand what you're instructing me.. kindly explain further

      Comment

      • ak1dnar
        Recognized Expert Top Contributor
        • Jan 2007
        • 1584

        #4
        Originally posted by mirianCalin
        what do you mean by "local machine"? i cant understand what you're instructing me.. kindly explain further
        Mirian, you haven't tell us about the operating system that you are using. What sandeepsandeep is saying actually if you are using a windows machine (Local Machine == Your PC), set the full path to save the file.
        Code:
        mysqldump -u<username> -p database_name >  /path/to/filename.sql

        Comment

        • hsriat
          Recognized Expert Top Contributor
          • Jan 2008
          • 1653

          #5
          Originally posted by mirianCalin
          i am doing the programming at home and our teacher checks it in school that's why i need to export/import my database.. but i dont know how..
          i've found this instruction on the net but i cant understand

          1. Export A MySQL Database
          This example shows you how to export a database. It is a good idea to export your data often as a backup.

          # mysqldump -u username -ppassword database_name > FILE.sql

          Replace username, password and database_name with your MySQL username, password and database name.

          File FILE.sql now holds a backup of your database, download it to your computer.

          2. Import A MySQL Database

          Here, we import a database. Use this to restore data from a backup or to import from another MySQL server.

          Start by uploading the FILE.sql file to the server where you will be running this command.

          # mysql -u username -ppassword database_name < FILE.sql

          Replace the parts in red with your own information.

          This powerful, easy to use command has many uses. Let's say you wanted to switch web hosting providers.

          Simply export your data on the old provider's server and import it on your account with the new host.


          in #1 it says that i have to download "FILE.sql" to my computer.. but the problem is i dont know where will i find "FILE.sql"

          There is one simple solution for your problem....
          Use HEIDI SQL (free download)

          http://www.heidisql.co m/

          Just a button will do the whole job..

          (Open both the connections in different Heidi SQL window and then click on the export button in the one whom you want to export.)

          Comment

          • ak1dnar
            Recognized Expert Top Contributor
            • Jan 2007
            • 1584

            #6
            Originally posted by hsriat
            There is one simple solution for your problem....
            Use HEIDI SQL (free download)

            http://www.heidisql.co m/

            Just a button will do the whole job..

            (Open both the connections in different Heidi SQL window and then click on the export button in the one whom you want to export.)
            Why not MySQL GUI tools And phpMyAdmin

            Comment

            • hsriat
              Recognized Expert Top Contributor
              • Jan 2008
              • 1653

              #7
              Originally posted by ak1dnar

              ummm...
              Actually I exported my database using heidiSQL, and I found it easy to use than phpMyAdmin.

              I haven't used used My SQL GUI tools..., but this migration tool seems to be interesting...

              Comment

              Working...