me小怪兽

导航

mysql5.7版本升级__超详细

mysql版本下载https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz

1.备份mysql的bin目录下所有文件

[root@localhost ~]# cd /home/mysql
[root@localhost mysql]# ls
bin data include man mysql.sock.lock share
COPYING docs lib mysql.sock README support-files
[root@localhost mysql]# tar zcf bin.tar.gz bin


2.将下载好的新版本mysql解压并把新bin下*拷贝到旧bin*
新版本的版本:mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz

[root@localhost mysql]# tar zxvf mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz
[root@localhost mysql]# /etc/init.d/mysql stop
[root@localhost mysql]# \cp -r /root/mysql-5.7.38-linux-glibc2.12-x86_64/bin/* /home/mysql/bin/
[root@localhost mysql]# /etc/init.d/mysql start


3.更新操作

[root@localhost mysql]# mysql_upgrade -uroot -p123456 --force --skip-version-check -S /home/mysql/mysql.sock

Enter password:
Running queries to upgrade MySQL server.
Checking system database.
mysql.columns_priv OK
mysql.db OK
mysql.engine_cost OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.gtid_executed OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.server_cost OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.slow_log OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
sys.sys_config OK
Upgrade process completed successfully.
Checking if update is needed.
#升级完登录mysql

[root@localhost mysql]# mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.7.38-log MySQL Community Server (GPL)
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
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> select version();
+------------+
| version() |
+------------+
| 5.7.38-log |
+------------+
1 row in set (0.00 sec)

[root@localhost mysql]# mysql -V    #版本查看

  mysql Ver 14.14 Distrib 5.7.38, for linux-glibc2.12 (x86_64) using EditLine wrapper

此时mysql升级完成

posted on 2022-08-21 22:51  me小怪兽  阅读(1024)  评论(0编辑  收藏  举报