会遇到的问题: 1.mysqldump 是备份数据库的命令,不懂直接百度就好。 2.Crontab 是定时任务的命令,如果不懂可以访问http://www.thinkphp.cn/code/1... 3.备份数据首先要确定已经给root设置了密码,否则会报mysqldump执行时Got error: 1045: Access denied for user ‘root’@’localhost’ (using password: YES) when trying to connect
解决办法:
登录mysql客户端
1
2
3
4
5
mysql -hserverip -uroot -p
mysql> usemysql; Database changed
mysql> update user set password=password('newpassword') where user='root'; Query OK, 4 rows affected (0.00 sec) Rows matched: 4 Changed: 4 Warnings: 0