数据库备份
mysqldump -u root -p DBname table1 table2 > path
e.g. mysqldump -u root -p Manhattan > ~/Documents/Manhattan.sql
数据库恢复
mysql -u root -p < path
e.g.mysql -u root -p < ~/Documents/Manhattan.sql
不过在用的过程中bash提示没有mysqldump命令,所以查找一下:
find / -name mysqldump -print
找到:
/usr/local/mysql-5.7.9-osx10.9-x86_64/bin/mysqldump
做link:
sudo ln -s /usr/local/mysql-5.7.9-osx10.9-x86_64/bin/mysqldump /usr/bin