Windows Server 2008 R2 MySQL 5.5 (msi install)
I made a backup:
mysql -uuser -p --single-transaction --add-drop-database --databases mysql db1 db2 db3 --result-file="C:\ProgramData\mysql\mysql server 5.5\data\backup.sql"
But it's not restoring successfully:
mysql -u root -p --verbose < bakcup.sql
Enter password:
--------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */
--------------
--------------
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */
--------------
--------------
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */
--------------
--------------
/*!40101 SET NAMES utf8 */
--------------
--------------
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */
--------------
--------------
/*!40103 SET TIME_ZONE='+00:00' */
--------------
--------------
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */
--------------
--------------
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */
--------------
--------------
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */
--------------
--------------
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */
--------------
--------------
/*!40000 DROP DATABASE IF EXISTS `mysql`*/
--------------
ERROR 1146 (42S02) at line 22: Table 'mysql.proc' doesn't exist
Now all my tables are gone in the mysql database ... I guess because I used the --add-drop-database option in my backup. I'm not sure why, but fortunately I can still login to the server at this point in spite of it not have any user tables.
EDIT: I believe being able to still login is similar to privileges not changing until they're flushed.
I'm not sure why "'mysql.proc' doesn't exist" is an issue, since it was supposed to be dropped before getting restored.