Exporting database from a linux server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Alien
    New Member
    • Sep 2007
    • 61

    Exporting database from a linux server

    Hi,

    I am trying to export a database in my linux server into another server. I did some googling on mysqldump which basically dumps the content of the table on how to create it into a text file.

    I used the following query:


    mysqldump web15db1 > sql.dump

    where web15db1 is the name of my database.

    And i get a syntax error:
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqldump web15db1 > sql.dump' at line 1
    I did it after loggin into mysql shell.

    Please help me as I urgently need to export the database.
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    mysqldump is not a SQL statement. It is a command line tool that is supposed to be used from outside MySQL.

    Comment

    • tomarvijay80
      New Member
      • Nov 2006
      • 10

      #3
      use
      mysqldump --databases your_database_n ame > new_database_na me.txt

      run this on mysql.

      Hope this will help u.

      Comment

      • coolsti
        Contributor
        • Mar 2008
        • 310

        #4
        Originally posted by tomarvijay80
        use
        mysqldump --databases your_database_n ame > new_database_na me.txt

        run this on mysql.

        Hope this will help u.
        Hope I may hop in to add some clarifications to this.

        You want to run the above not within "mysql" but externally to mysql. Meaning, you run this mysqldump command in a Linux terminal window.

        Also, depending on the permissions set up for your database, you may have to supply some additional arguments to specify a username and possibly the corresponding password for that user.

        Comment

        Working...