So now you've hit the point every Drupaller fears: your site has crashed, and you need to restore it. When was the last time you backed it up?
Fortunately, if you've installed Drupal in AFS space, both the files and the database get backed up nightly (yay!), shortly after midnight. (If you want to make an intra-day backup, see this guide.)
There are two steps to this process:
You can do this using Terminal on the Mac (in /Applications/Utilities) or using SecureCRT on the PC.
Connect to Corn
Drop the (corrupt, existing) Database
mysqladmin -u databaseusername -h mysql-user.stanford.edu -p drop drupal_database_name
Create a (so fresh and so clean, clean) New Database
mysqladmin -u databaseusername -h mysql-user.stanford.edu -p create drupal_database_name
Restore from the .sql Backup File
mv drupal_database_name.sql.0 drupal_database_name.sql
mysql -u databaseusername -h mysql-user.stanford.edu -p drupal_database_name < drupal_database_name.sql
Note About Error Messages
If, in restoring your database from the .sql backup, you encounter an error such as:
ERROR 1064 at line 2533: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DELIMITER' at line 1
do not fear. It refers to stored routines in a MySQL database, which Drupal typically does not use. The error should not stop your restore from working. For more information, search the drupallers listserv at https://mailman.stanford.edu/mailman/suprivate/drupallers/
Delete and Restore Your Files:
Enter the following text at the command prompt and then hit Enter after each line:
rm -fr /afs/ir/group/groupname/cgi-bin/drupal
cp -r /afs/ir/group/groupname/.backup/cgi-bin/drupal /afs/ir/group/groupname/cgi-bin/
Congratulations! You can breathe easy again!