我想从命令行关闭 mysql 服务器。
如果我使用taskkill.exe
或强制使用,它会停止 mysql 服务器,但是当我再次启动 mysql 时。表明
2013-08-31 16:00:35 3940 [Note] InnoDB: Database was not shutdown normally!
2013-08-31 16:00:35 3940 [Note] InnoDB: Starting crash recovery.
2013-08-31 16:00:35 3940 [Note] InnoDB: Reading tablespace information from the .ibd files...
2013-08-31 16:00:35 3940 [Note] InnoDB: Restoring possible half-written data pages
2013-08-31 16:00:35 3940 [Note] InnoDB: from the doublewrite buffer...
2013-08-31 16:00:35 3940 [Note] InnoDB: 128 rollback segment(s) are active.
2013-08-31 16:00:35 3940 [Note] InnoDB: Waiting for purge to start
2013-08-31 16:00:35 3940 [Note] InnoDB: 5.6.13 started; log sequence number 1600927
2013-08-31 16:00:35 3940 [Note] Recovering after a crash using mysql-bin
2013-08-31 16:00:35 3940 [Note] Starting crash recovery...
2013-08-31 16:00:35 3940 [Note] Crash recovery finished.
恢复实际上需要时间来启动服务器。如果数据库非常大,有时它也无法启动。
所以我想正常关机,如:
mysqladmin -u root -pmysql shutdown
上面的命令有效,但MySQL Root 密码可能会改变,所以我想要一个类似的 Mac OS X 命令用于Windows:
mysqladmin -u root -p$(cat /path/to/mysql/root/password) shutdown
基本上我想从文件中读取密码。DOS下可以吗?
有什么帮助吗?谢谢。