重装系统后用以下命令再恢复mysql安装数据库:
C:\Program Files\mysql-5.5.41-winx64\bin>mysqld --install mysql --defaults-file="C:\Program Files\mysql-5.5.41-winx64\my.ini"
一直无法启动..如图所示,一开始把一些看似无用的文件删除了,还好不是永久删除.最后看 Win10.err错误日志里看到有和mysql-bin.000001 相关的记录,再恢复之后再启动mysql就正常了.
C:\Program Files\mysql-5.5.41-winx64\bin>net start mysql
mysql 服务正在启动 ...
mysql 服务无法启动。
系统出错。
发生系统错误 1067。
进程意外终止。
C:\Program Files\mysql-5.5.41-winx64\bin>net start mysql
mysql 服务正在启动 ...
mysql 服务已经启动成功。
C:\Program Files\mysql-5.5.41-winx64\bin>mysql -uroot -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.41-log MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> \q
Bye
C:\Program Files\mysql-5.5.41-winx64\bin>