How to use MySQL dump from a remote machine

前端 未结 7 1461
刺人心
刺人心 2020-12-12 12:41

How can I backup a mysql database which is running on a remote server, I need to store the back up file in the local pc.

相关标签:
7条回答
  • 2020-12-12 13:45

    Have you got access to SSH?

    You can use this command in shell to backup an entire database:

    mysqldump -u [username] -p[password] [databasename] > [filename.sql]
    

    This is actually one command followed by the > operator, which says, "take the output of the previous command and store it in this file."

    Note: The lack of a space between -p and the mysql password is not a typo. However, if you leave the -p flag present, but the actual password blank then you will be prompted for your password. Sometimes this is recommended to keep passwords out of your bash history.

    0 讨论(0)
提交回复
热议问题