從mysql8.0.15升級到8.0.16

從mysql8.0.15升級到8.0.16

環境簡介

操做系統:Centos 6.10 64位html

目前版本:8.0.15 MySQL Community Server 二進制mysql

目的:升級爲8.0.16linux

安裝目錄:/data/mysql/mysql_3306sql

 

1、升級步驟

一、下載軟件;數據庫

二、一致性停庫;ide

三、備份數據;ui

四、修改軟鏈接;spa

五、啓動數據庫;操作系統

六、升級數據庫;code

七、驗證。

 1. 下載軟件

因爲是glibc-2.12-1.212.el6.x86_64,因此下載對應的mysql版本。

[root@db144 mysql_3306]# rpm -qa| grep glib glibc-common-2.12-1.212.el6.x86_64 glibc-2.12-1.212.el6.x86_64 dbus-glib-0.86-6.el6.x86_64 glibc-headers-2.12-1.212.el6.x86_64 glib2-2.28.8-10.el6.x86_64 glibc-devel-2.12-1.212.el6.x86_64 [root@db144 mysql_3306]#

[root@db144 ~]# mysql.3306.login
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 9
Server version: 8.0.15 MySQL Community Server - GPL

 
 

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

 
 

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> show databases;
+--------------------+
| Database |
+--------------------+
| db144 |
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.36 sec)

 
 

mysql> exit

 

[root@db144 mysql_3306]# cd /opt/ [root@db144 opt]# ll total 367488 drwxr-xr-x. 9 root root      4096 Apr 10 00:00 mysql-8.0.15-linux-glibc2.12-x86_64 -rw-r--r--. 1 root root 376303592 Apr  4 16:20 mysql-8.0.15-linux-glibc2.12-x86_64.tar.xz [root@db144 opt]# wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.16-linux-glibc2.12-x86_64.tar.xz
# 解壓安裝包
[root@db144 opt]# tar -xJf mysql-8.0.16-linux-glibc2.12-x86_64.tar.xz

# 停庫

[root@db144 opt]# cd /usr/local/
[root@db144 local]# ll
total 40
drwxr-xr-x. 2 root root 4096 Sep 23 2011 bin
drwxr-xr-x. 2 root root 4096 Sep 23 2011 etc
drwxr-xr-x. 2 root root 4096 Sep 23 2011 games
drwxr-xr-x. 2 root root 4096 Sep 23 2011 include
drwxr-xr-x. 2 root root 4096 Sep 23 2011 lib
drwxr-xr-x. 2 root root 4096 Sep 23 2011 lib64
drwxr-xr-x. 2 root root 4096 Sep 23 2011 libexec
lrwxrwxrwx. 1 root root 40 Apr 10 00:15 mysql -> /opt/mysql-8.0.15-linux-glibc2.12-x86_64
drwxr-xr-x. 2 root root 4096 Sep 23 2011 sbin
drwxr-xr-x. 5 root root 4096 Mar 12 22:38 share
drwxr-xr-x. 2 root root 4096 Sep 23 2011 src
[root@db144 local]# mysql.3306.stop
[1] 9775
[root@db144 local]# mysqladmin: [Warning] Using a password on the command line interface can be insecure.

[1]+ Done /usr/local/mysql/bin/mysqladmin -h127.0.0.1 -P 3306 -uroot -p'AnvcTMagdLarwNV3CKaC' shutdown
[root@db144 local]#

[root@db144 local]# unlink mysql

# 備份數據目錄

[root@db144 local]# cp -r /data/mysql/mysql_3306 /data/mysql/mysql_3306.bak

# 作軟鏈接

[root@db144 local]# ln -s /opt/mysql-8.0.16-linux-glibc2.12-x86_64 /usr/local/mysql
[root@db144 local]# ll
total 40
drwxr-xr-x. 2 root root 4096 Sep 23 2011 bin
drwxr-xr-x. 2 root root 4096 Sep 23 2011 etc
drwxr-xr-x. 2 root root 4096 Sep 23 2011 games
drwxr-xr-x. 2 root root 4096 Sep 23 2011 include
drwxr-xr-x. 2 root root 4096 Sep 23 2011 lib
drwxr-xr-x. 2 root root 4096 Sep 23 2011 lib64
drwxr-xr-x. 2 root root 4096 Sep 23 2011 libexec
lrwxrwxrwx. 1 root root 40 May 5 18:21 mysql -> /opt/mysql-8.0.16-linux-glibc2.12-x86_64
drwxr-xr-x. 2 root root 4096 Sep 23 2011 sbin
drwxr-xr-x. 5 root root 4096 Mar 12 22:38 share
drwxr-xr-x. 2 root root 4096 Sep 23 2011 src
[root@db144 local]# chown -R mysql.mysql mysql
[root@db144 local]#

# 啓動數據庫

[root@db144 local]# mysql.3306.start
[1] 9801
[root@db144 local]# 2019-05-05T10:22:01.454070Z mysqld_safe Logging to '/data/mysql/mysql_3306/logs/error.log'.
2019-05-05T10:22:01.630984Z mysqld_safe Starting mysqld daemon with databases from /data/mysql/mysql_3306/data

 # my.cnf中去掉這個參數  #internal_tmp_disk_storage_engine = InnoDB

[root@db144 local]# mysql_upgrade -s -uroot -p -h 127.0.0.1 -P 3306
Enter password:
The mysql_upgrade client is now deprecated. The actions executed by the upgrade client are now done by the server.
To upgrade, please start the new MySQL binary with the older data directory. Repairing user tables is done automatically. Restart is not required after upgrade.
The upgrade process automatically starts on running a new MySQL binary with an older data directory. To avoid accidental upgrades, please use the --upgrade=NONE option with the MySQL binary. The option --upgrade=FORCE is also provided to run the server upgrade sequence on demand.
It may be possible that the server upgrade fails due to a number of reasons. In that case, the upgrade sequence will run again during the next MySQL server start. If the server upgrade fails repeatedly, the server can be started with the --upgrade=MINIMAL option to start the server without executing the upgrade sequence, thus allowing users to manually rectify the problem.
[root@db144 local]#

 # 經查證,如今已經不使用這個了,服務在啓動時,自動幫你升級完畢了。

 

[root@db144 local]# mysql.3306.login
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 9
Server version: 8.0.16 MySQL Community Server - GPL

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

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> \s;
--------------
/usr/local/mysql/bin/mysql Ver 8.0.16 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)

Connection id: 9
Current database:
Current user: root@127.0.0.1
SSL: Cipher in use is DHE-RSA-AES128-GCM-SHA256
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.0.16 MySQL Community Server - GPL
Protocol version: 10
Connection: 127.0.0.1 via TCP/IP
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4
TCP port: 3306
Uptime: 9 min 9 sec

Threads: 2 Questions: 8 Slow queries: 0 Opens: 1133 Flush tables: 3 Open tables: 16 Queries per second avg: 0.014
--------------

ERROR:
No query specified

mysql> exit
Bye
[root@db144 local]#

 

 

附錄 :

社區版的8.0.15的安裝方法:https://www.cnblogs.com/bjx2020/p/10682518.html

相關文章
相關標籤/搜索