Как исправить ошибку "Could not login with user ID #0"
On some projects, when I use drush, I get the error "Could not login with user ID #0". Drush also says that "This is typically caused by importing a MySQL database dump from a faulty tool which re-numbered the anonymous user ID in the users table. See http://drupal.org/node/1029506 for help recovering from this situation." This error comes because uid = 0 got deleted in the "users" table. There are two ways to fix this problem.
Use user 1 instead of user 0
Simply use the option "-u 1" in the drush statement. So "drush cc all" will become "drush -u 1 cc all". With this argument, drush will load user 1 instead of user 0. This is a pretty easy quick-and-dirty workaround. You will have to use this argument every time you run drush.
Restore user 0 in the "users" table
This is a better and permanent fix. You can add user 0 to the "users" table. Execute the following MySQL query
insert into users (name, pass, mail, theme, signature, language, init, timezone) values ('', '', '', '', '', '', '', ''); update users set uid = 0 where name = '';
The first query inserts an empty row in the MySQL database. The second query sets the uid of the empty row to be 0. Now, when you execute any drush command, you should not get the error "Could not login with user ID #0".