查看日志信息,会出现 141011 09:44:02 innobackupex: Executing FLUSH ENGINE LOGS... 141011 09:44:02 innobackupex: Waiting for log copying to finish
xtrabackup: The latest check point (for incremental): '14275993522' xtrabackup: Stopping log copying thread. .>> log scanned up to (14275993522)
xtrabackup: Creating suspend file '/tmp/xtrabackup_log_copied' with pid '19659' 141011 09:44:03 innobackupex: All tables unlocked 141011 09:44:03 innobackupex: Waiting for ibbackup (pid=19659) to finish xtrabackup: Transaction log of lsn (14275990028) to (14275993522) was copied.
innobackupex: Backup created in directory '/mysqlbak/innobackupex' 141011 09:44:04 innobackupex: Connection to database server closed innobackupex: You must use -i (--ignore-zeros) option for extraction of the tar stream. 141011 09:44:04 innobackupex: completed OK! 表示备份成功。
恢复需要一点点的时间,出现下面信息表示恢复成功。 innobackupex: Starting to copy InnoDB system tablespace innobackupex: in '/u02/backup' innobackupex: back to original InnoDB data directory '/u01/mysql/data' innobackupex: Copying '/u02/backup/ibdata1' to '/u01/mysql/data/ibdata1'
innobackupex: Starting to copy InnoDB undo tablespaces innobackupex: in '/u02/backup' innobackupex: back to '/u01/mysql/data'
innobackupex: Starting to copy InnoDB log files innobackupex: in '/u02/backup' innobackupex: back to original InnoDB log directory '/u01/mysql/data' innobackupex: Copying '/u02/backup/ib_logfile1' to '/u01/mysql/data/ib_logfile1' innobackupex: Copying '/u02/backup/ib_logfile0' to '/u01/mysql/data/ib_logfile0' innobackupex: Finished copying back files.
恢复第三步:修改文件权限。 cd 到data目录 chown -R mysql.mysql data/
2、权限:应该恢复使用的是root用户,但是MySQL需要MySQL用户去访问。 [root@newbidb support-files]# ./mysql.server restart MySQL server PID file could not be found![FAILED] Starting MySQL.The server quit without updating PID file (/u01/mysql/data/newbidb.pid).[FAILED]
3、连接MySQL的时候 [root@newbidb bin]# ./mysql -uroot -p Enter password: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 没有这个文件,touch mysql.sock 并修改文件权限。