当前位置:网站首页>mysql 5.1升级到5.66

mysql 5.1升级到5.66

2022-04-23 14:06:00 franket

停止mysql

[root@upgrade-slave mysql]# /etc/init.d/mysql stop 
Shutting down MySQL.                                       [  OK  ]
[root@upgrade-slave mysql]# 

创建当前快照

便于恢复到当前状态

[root@upgrade-slave ~]# df  -h 
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_test_for_mysqlupgrade-lv_root
                       99G  3.4G   90G   4% /
tmpfs                  63G     0   63G   0% /dev/shm
/dev/sda1             477M   62M  390M  14% /boot
/dev/mapper/vg_test_for_mysqlupgrade-lv_data
                      1.7T  927G  726G  57% /data
/dev/mapper/vg_test_for_mysqlupgrade-lv_home
                       50G   53M   47G   1% /home
/dev/mapper/vg_test_for_mysqlupgrade-lv_var
                       99G  302M   94G   1% /var
[root@upgrade-slave ~]# lvs
  LV      VG             Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv_data vg_test_for_mysqlupgrade -wi-ao----   1.73t                                                    
  lv_home vg_test_for_mysqlupgrade -wi-ao----  50.00g                                                    
  lv_root vg_test_for_mysqlupgrade -wi-ao---- 100.00g                                                    
  lv_swap vg_test_for_mysqlupgrade -wi-ao----  16.00g                                                    
  lv_var  vg_test_for_mysqlupgrade -wi-ao---- 100.00g                                                    
[root@upgrade-slave ~]# vgs
  VG             #PV #LV #SN Attr   VSize VFree  
  vg_test_for_mysqlupgrade   1   5   0 wz--n- 2.18t 200.00g
[root@upgrade-slave ~]# lvcreate  -L 150G -s -n lv_s_data /dev/vg_test_for_mysqlupgrade/lv_data 
  Logical volume "lv_s_data" created.
[root@upgrade-slave ~]# lvs
  LV        VG             Attr       LSize   Pool Origin  Data%  Meta%  Move Log Cpy%Sync Convert
  lv_data   vg_test_for_mysqlupgrade owi-aos---   1.73t                                                     
  lv_home   vg_test_for_mysqlupgrade -wi-ao----  50.00g                                                     
  lv_root   vg_test_for_mysqlupgrade -wi-ao---- 100.00g                                                     
  lv_s_data vg_test_for_mysqlupgrade swi-a-s--- 150.00g      lv_data 0.00                                   
  lv_swap   vg_test_for_mysqlupgrade -wi-ao----  16.00g                                                     
  lv_var    vg_test_for_mysqlupgrade -wi-ao---- 100.00g                                                     
[root@upgrade-slave ~]# 

检查mysql状态

[root@upgrade-slave src]# ps faux | grep mysql 
root      11270  0.0  0.0 103308   824 pts/1    S+   21:22   0:00  |                       \_ grep mysql
root     136775  0.0  0.0 189236  3732 pts/2    S+   20:58   0:00  |           \_ sudo tail -f /var/lib/mysql/upgrade-slave.err
root     136889  0.0  0.0 100944   612 pts/2    S+   20:58   0:00  |               \_ tail -f /var/lib/mysql/upgrade-slave.err
root     137921  0.0  0.0 189236  3736 pts/3    S+   20:59   0:00              \_ sudo tail -f /var/lib/mysql/upgrade-slave.err
root     137993  0.0  0.0 100944   608 pts/3    S+   20:59   0:00                  \_ tail -f /var/lib/mysql/upgrade-slave.err
[root@upgrade-slave src]# /etc/init.d/mysql  status
MySQL is not running                                       [FAILED]
[root@upgrade-slave src]# 

版权声明
本文为[franket]所创,转载请带上原文链接,感谢
https://cloud.tencent.com/developer/article/1986101