mysql 5.1升级到5.65

2022-04-16 17:45:08 浏览数 (1)

恢复数据

代码语言:javascript复制
[root@upgrade-slave nfs]# time nohup  innobackupex  --copy-back  masterdb.full.backup/2015-11-25_21-25-02/  >> /tmp/fullcopyback.log  2>&1   & 
[1] 117341
[root@upgrade-slave nfs]# 
[root@upgrade-slave nfs]# tail -f /tmp/fullcopyback.log   
innobackupex: Copying '/data/nfs/masterdb.full.backup/2015-11-25_21-25-02/mysql/general_log.CSV' to '/var/lib/mysql/mysql/general_log.CSV'
innobackupex: Copying '/data/nfs/masterdb.full.backup/2015-11-25_21-25-02/mysql/func.MYI' to '/var/lib/mysql/mysql/func.MYI'
innobackupex: Copying '/data/nfs/masterdb.full.backup/2015-11-25_21-25-02/mysql/time_zone_leap_second.MYD' to '/var/lib/mysql/mysql/time_zone_leap_second.MYD'
innobackupex: Creating directory '/var/lib/mysql/key_db'
innobackupex: Copying '/data/nfs/masterdb.full.backup/2015-11-25_21-25-02/key_db/user_connections.ibd' to '/var/lib/mysql/key_db/user_connections.ibd'
...
...
innobackupex: Starting to copy InnoDB log files
innobackupex: in '/data/nfs/masterdb.full.backup/2015-11-25_21-25-02'
innobackupex: back to original InnoDB log directory '/var/lib/mysql'
innobackupex: Copying '/data/nfs/masterdb.full.backup/2015-11-25_21-25-02/ib_logfile1' to '/var/lib/mysql/ib_logfile1'
innobackupex: Copying '/data/nfs/masterdb.full.backup/2015-11-25_21-25-02/ib_logfile2' to '/var/lib/mysql/ib_logfile2'
innobackupex: Copying '/data/nfs/masterdb.full.backup/2015-11-25_21-25-02/ib_logfile0' to '/var/lib/mysql/ib_logfile0'
innobackupex: Finished copying back files.

151126 20:41:40  innobackupex: completed OK!

real	33m3.933s
user	0m0.963s
sys	4m54.254s


[1]   Done                    time nohup innobackupex --copy-back masterdb.full.backup/2015-11-25_21-25-02/ >> /tmp/fullcopyback.log 2>&1
[root@upgrade-slave nfs]#

修改权限

代码语言:javascript复制
[root@upgrade-slave ~]# cd /var/lib/mysql/
[root@upgrade-slave mysql]# ls
huodongdb  something_more  ib_logfile0  istuffdb    mysql        feeddb
historydb   stuffdb      ib_logfile1  caldb    mytempdb      test
testdb    ibdata1      ib_logfile2  mupgradetest_pd  key_db  xtrabackup_binlog_pos_innodb
[root@upgrade-slave mysql]# ll 
total 5916788
drwxr-xr-x. 2 root root       4096 Nov 26 20:10 huodongdb
drwxr-xr-x. 2 root root       4096 Nov 26 20:12 historydb
drwxr-xr-x. 2 root root      53248 Nov 26 20:41 testdb
drwxr-xr-x. 2 root root       4096 Nov 26 20:18 something_more
drwxr-xr-x. 2 root root       4096 Nov 26 20:11 stuffdb
-rw-r--r--. 1 root root 5253365760 Nov 26 20:41 ibdata1
-rw-r--r--. 1 root root  268435456 Nov 26 20:41 ib_logfile0
-rw-r--r--. 1 root root  268435456 Nov 26 20:41 ib_logfile1
-rw-r--r--. 1 root root  268435456 Nov 26 20:41 ib_logfile2
drwxr-xr-x. 2 root root       4096 Nov 26 20:11 istuffdb
drwxr-xr-x. 2 root root      12288 Nov 26 20:18 caldb
drwxr-xr-x. 2 root root       4096 Nov 26 20:18 mupgradetest_pd
drwxr-xr-x. 2 root root       4096 Nov 26 20:08 mysql
drwxr-xr-x. 2 root root       4096 Nov 26 20:10 mytempdb
drwxr-xr-x. 2 root root       4096 Nov 26 20:10 key_db
drwxr-xr-x. 2 root root       4096 Nov 26 20:11 feeddb
drwxr-xr-x. 2 root root       4096 Nov 26 20:11 test
-rw-r--r--. 1 root root         29 Nov 26 20:08 xtrabackup_binlog_pos_innodb
[root@upgrade-slave mysql]# cd ..
[root@upgrade-slave lib]# chown  -R mysql.mysql /var/lib/mysql/
[root@upgrade-slave lib]# ll /var/lib/mysql/
total 5916788
drwxr-xr-x. 2 mysql mysql       4096 Nov 26 20:10 huodongdb
drwxr-xr-x. 2 mysql mysql       4096 Nov 26 20:12 historydb
drwxr-xr-x. 2 mysql mysql      53248 Nov 26 20:41 testdb
drwxr-xr-x. 2 mysql mysql       4096 Nov 26 20:18 something_more
drwxr-xr-x. 2 mysql mysql       4096 Nov 26 20:11 stuffdb
-rw-r--r--. 1 mysql mysql 5253365760 Nov 26 20:41 ibdata1
-rw-r--r--. 1 mysql mysql  268435456 Nov 26 20:41 ib_logfile0
-rw-r--r--. 1 mysql mysql  268435456 Nov 26 20:41 ib_logfile1
-rw-r--r--. 1 mysql mysql  268435456 Nov 26 20:41 ib_logfile2
drwxr-xr-x. 2 mysql mysql       4096 Nov 26 20:11 istuffdb
drwxr-xr-x. 2 mysql mysql      12288 Nov 26 20:18 caldb
drwxr-xr-x. 2 mysql mysql       4096 Nov 26 20:18 mupgradetest_pd
drwxr-xr-x. 2 mysql mysql       4096 Nov 26 20:08 mysql
drwxr-xr-x. 2 mysql mysql       4096 Nov 26 20:10 mytempdb
drwxr-xr-x. 2 mysql mysql       4096 Nov 26 20:10 key_db
drwxr-xr-x. 2 mysql mysql       4096 Nov 26 20:11 feeddb
drwxr-xr-x. 2 mysql mysql       4096 Nov 26 20:11 test
-rw-r--r--. 1 mysql mysql         29 Nov 26 20:08 xtrabackup_binlog_pos_innodb
[root@upgrade-slave lib]#

启动服务

0 人点赞