我最近将服务器升级到 Debian 9,并将 MySQL 升级到最新版本。我有一个简单的备份脚本,在生产站点上执行任何工作之前运行该脚本,但这一次,在运行脚本时,我遇到以下情况:
mysqldump: unknown variable 'local-infile=0'
Run Code Online (Sandbox Code Playgroud)
这是我的脚本。这是怎么回事?
#!/bin/bash
# [skipping commentary]
SITE=prod
# Set the directory that the Drupal root is IN, no trailing slashes
DROOT=[website_root]
# Set the directory for storing backups, no trailing slashes
BUD=/$DROOT/notes/backups
# Don't edit; End of defining variables
echo Doing a full back up...
echo Prepare to enter MySQL password...
# tar -czf $BUD/$SITE-files-$(date +'%Y%m%d%H%M%S').tgz $DROOT/docroot
mysqldump -u mysql_user -p drupal > $BUD/$SITE-drupal-$(date +'%Y%m%d%H%M%S').sql
mysqldump -u mysql_user -p civicrm > $BUD/$SITE-civicrm-$(date …Run Code Online (Sandbox Code Playgroud) 我做了一个git status,注意到一堆应该被暂存的文件git ignore,例如我的 Drupal 站点的 、 和设置文件.gitignore。.htaccess
我错误地使用git checkout <file>而不是git rm <file>将它们从暂存区中删除。虽然看起来可行,但我破坏了该网站。我想我现在明白这git checkout会恢复我对这些文件所做的任何更改,对吗?这些更改没有提交,因为它们一开始就不应该被跟踪。
应该如何git checkout <file>使用以及它的反面是什么?最重要的是,我如何撤消撤消操作或者我该去哪里?