|
A few days ago, work until 10 pm, and on the way back, a friend called and said their company's development and maintenance personnel in the updated version of the online system, accidentally online database to drop out , told me over the fire, alas! Although the operation and maintenance sector has also removed many years, this is the first time see the case of Kazakhstan, is excited and worried With the mood to go to the scene, the excitement is good because you can combat it, fear is not afraid to help a friend, alas, nonsense Not much to say, on the "battlefield."
The first step, since the databases have been killed, not any shots from, had to shut down all system programs.
The second step, to look at a pack a day prepared, fortunately, 3:30, there was to do a full backup, backup is a way to tar the whole package directory, binlog function is also open, still today binlog log . Unpack the tar out immediately omitted here ten thousand words, only 50GB package, unpack it took nearly one hour of time, just want to say a treasure cloud host, the hard disk is really a pit.
The third step, check to see what backups can not be used, in order to save time, directly to the extract from the Library folder, directly next to the MV mysql datadir, the mysql start up, select a table of data, suggesting that the table does not exist Khan, do not back up the data in question, sweat flow out, show engines, view the engine, and then checked the my.ini, ha ha, I had to use the InnoDB engine, not directly separate mv library folder, no matter, directly to the entire backup folder directly MV over, then a check of data, 3:30 before the data is intact, this time, the mood began to some beautiful, even if the data brought back DROP off, at least a large data portion no problem, just a little today, 3:30 to 22:00, after which most of the day's data.
The fourth step is to find today's binlog log, compared at the time, find the mysql_bin.0000XX, directly to the next cp tmp directory, enter the command: mysqlbinlog --start-date = "2016-01-20 03:30:00 "--stop-date =" 2016-01-20 22:00:00 "mysql_bin.0000xx> /tmp/test.sql, quickly, sql statements to turn out, looked directly VIM last sql statement, Verify that no drop database statement.
The fifth step, log mysql, direct source /tmp/test.sql; waiting for 15 minutes now, recovery is over, let them confirm the next data there is no problem, no problem the final confirmation. |
|
|
|