mysqldump, DEV notes

DEV notes:

備份mysql:
mysqldump -u [user] -p [databasename] > [YYYYMMDDbackup.sql]

mysqldump -u [user] -p [databasename] [table1 table2] > [YYYYMMDDbackup.sql]

轉server, 抄DB:
mysqldump -u [user] --password=[password] [databasename] | mysql -u [user] --password=[password] [databasname2]

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <h4> <h3>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options