12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
ADADADADAD
mysql数据库 时间:2024-12-25 09:56:58
作者:文/会员上传
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
12-09
本文介绍如何通过YUM升级Mysql的版本(默认用YUM安装的MySQL都是5.1的版本)环境:CENTOS6.9原Mysql 版本:5.1新Mysql 版本:5.6时间需要:3分钟以内注意: 做任何动作前,先做好数据备份和
以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。
本文介绍如何通过YUM升级Mysql的版本(默认用YUM安装的MySQL都是5.1的版本)
环境:CENTOS6.9
原Mysql 版本:5.1
新Mysql 版本:5.6
时间需要:3分钟以内
注意: 做任何动作前,先做好数据备份和恢复计划
[willson@heegw3o0cZ ~]$ sudo su - root
[root@heegw3o0cZ ~]#
[root@heegw3o0cZ ~]#
[root@heegw3o0cZ ~]# /etc/init.d/mysqld stop
Stopping mysqld:[OK]
[root@heegw3o0cZ~]# yum remove mysql
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package mysql.x86_64 0:5.1.73-8.el6_8 will be erased
--> Processing Dependency: mysql = 5.1.73-8.el6_8 for package: mysql-devel-5.1.73-8.el6_8.x86_64
--> Processing Dependency: mysql = 5.1.73-8.el6_8 for package: mysql-server-5.1.73-8.el6_8.x86_64
--> Running transaction check
---> Package mysql-devel.x86_64 0:5.1.73-8.el6_8 will be erased
---> Package mysql-server.x86_64 0:5.1.73-8.el6_8 will be erased
--> Processing Dependency: mysql-server for package: perl-Test-mysqld-0.17-3.el6.noarch
--> Running transaction check
---> Package perl-Test-mysqld.noarch 0:0.17-3.el6 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================
PackageArchVersionRepositorySize
===================================================================================
Removing:
mysqlx86_645.1.73-8.el6_8@updates2.4 M
Removing for dependencies:
mysql-develx86_645.1.73-8.el6_8@updates388 k
mysql-serverx86_645.1.73-8.el6_8@updates25 M
perl-Test-mysqldnoarch0.17-3.el6@epel14 k
Transaction Summary
===================================================================================
Remove4 Package(s)
Installed size: 27 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing: mysql-devel-5.1.73-8.el6_8.x86_641/4
Erasing: perl-Test-mysqld-0.17-3.el6.noarch2/4
Erasing: mysql-server-5.1.73-8.el6_8.x86_643/4
warning: /var/log/mysqld.log saved as /var/log/mysqld.log.rpmsave
Erasing: mysql-5.1.73-8.el6_8.x86_644/4
Verifying: perl-Test-mysqld-0.17-3.el6.noarch1/4
Verifying: mysql-server-5.1.73-8.el6_8.x86_642/4
Verifying: mysql-5.1.73-8.el6_8.x86_643/4
Verifying: mysql-devel-5.1.73-8.el6_8.x86_644/4
Removed:
mysql.x86_64 0:5.1.73-8.el6_8
Dependency Removed:
mysql-devel.x86_64 0:5.1.73-8.el6_8mysql-server.x86_64 0:5.1.73-8.el6_8
perl-Test-mysqld.noarch 0:0.17-3.el6
Complete!
[root@heegw3o0cZ ~]#
[root@heegw3o0cZ ~]# rpm -Uvh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
Retrieving http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
Preparing...########################################### [100%]
1:mysql-community-release########################################### [100%]
[root@heegw3o0cZ ~]# yum install mysql-community-server
Loaded plugins: fastestmirror
Setting up Install Process
Determining fastest mirrors
* base: mirrors.aliyuncs.com
* epel: mirrors.aliyuncs.com
* extras: mirrors.aliyuncs.com
* updates: mirrors.aliyuncs.com
base| 3.7 kB00:00
epel| 4.7 kB00:00
epel/primary_db| 6.0 MB00:00
extras| 3.4 kB00:00
extras/primary_db|29 kB00:00
mysql-connectors-community| 2.5 kB00:00
mysql-connectors-community/primary_db|17 kB00:00
mysql-tools-community| 2.5 kB00:00
mysql-tools-community/primary_db|38 kB00:00
mysql56-community| 2.5 kB00:00
mysql56-community/primary_db| 197 kB00:00
updates| 3.4 kB00:00
updates/primary_db| 5.3 MB00:00
zabbix|951 B00:00
zabbix-non-supported|951 B00:00
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.38-2.el6 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.38-2.el6 for package: mysql-community-server-5.6.38-2.el6.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-community-server-5.6.38-2.el6.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.38-2.el6 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.38-2.el6.x86_64
---> Package mysql-community-common.x86_64 0:5.6.38-2.el6 will be installed
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.6.38-2.el6 will be obsoleting
---> Package mysql-libs.x86_64 0:5.1.73-8.el6_8 will be obsoleted
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: 2:postfix-2.6.6-8.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: redland-1.0.7-11.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: 2:postfix-2.6.6-8.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: redland-1.0.7-11.el6.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64
--> Running transaction check
---> Package mysql-community-libs-compat.x86_64 0:5.6.38-2.el6 will be obsoleting
--> Finished Dependency Resolution
Dependencies Resolved
===================================================================================
PackageArchVersionRepositorySize
===================================================================================
Installing:
mysql-community-libsx86_645.6.38-2.el6mysql56-community1.9 M
replacingmysql-libs.x86_64 5.1.73-8.el6_8
mysql-community-libs-compatx86_645.6.38-2.el6mysql56-community1.6 M
replacingmysql-libs.x86_64 5.1.73-8.el6_8
mysql-community-serverx86_645.6.38-2.el6mysql56-community55 M
Installing for dependencies:
mysql-community-clientx86_645.6.38-2.el6mysql56-community18 M
mysql-community-commonx86_645.6.38-2.el6mysql56-community308 k
Transaction Summary
===================================================================================
Install5 Package(s)
Total download size: 77 M
Is this ok [y/N]: y
Downloading Packages:
(1/5): mysql-community-client-5.6.38-2.el6.x86_64.rpm|18 MB00:01
(2/5): mysql-community-common-5.6.38-2.el6.x86_64.rpm| 308 kB00:00
(3/5): mysql-community-libs-5.6.38-2.el6.x86_64.rpm| 1.9 MB00:00
(4/5): mysql-community-libs-compat-5.6.38-2.el6.x86_64.rpm| 1.6 MB00:00
(5/5): mysql-community-server-5.6.38-2.el6.x86_64.rpm|55 MB00:04
-----------------------------------------------------------------------------------
Total11 MB/s |77 MB00:06
warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Retrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : MySQL Release Engineering <mysql-build@oss.oracle.com>
Package: mysql-community-release-el6-5.noarch (installed)
From: file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
tomcat6-6.0.24-98.el6_8.noarch has missing requires of tomcat6-lib = ('0', '6.0.24', '98.el6_8')
tomcat6-admin-webapps-6.0.24-105.el6_8.noarch has missing requires of tomcat6 = ('0', '6.0.24', '105.el6_8')
tomcat6-webapps-6.0.24-105.el6_8.noarch has missing requires of tomcat6 = ('0', '6.0.24', '105.el6_8')
Installing : mysql-community-common-5.6.38-2.el6.x86_641/6
Installing : mysql-community-libs-5.6.38-2.el6.x86_642/6
Installing : mysql-community-client-5.6.38-2.el6.x86_643/6
Installing : mysql-community-server-5.6.38-2.el6.x86_644/6
warning: /etc/my.cnf created as /etc/my.cnf.rpmnew
Installing : mysql-community-libs-compat-5.6.38-2.el6.x86_645/6
Erasing: mysql-libs-5.1.73-8.el6_8.x86_646/6
Verifying: mysql-community-common-5.6.38-2.el6.x86_641/6
Verifying: mysql-community-libs-5.6.38-2.el6.x86_642/6
Verifying: mysql-community-libs-compat-5.6.38-2.el6.x86_643/6
Verifying: mysql-community-client-5.6.38-2.el6.x86_644/6
Verifying: mysql-community-server-5.6.38-2.el6.x86_645/6
Verifying: mysql-libs-5.1.73-8.el6_8.x86_646/6
Installed:
mysql-community-libs.x86_64 0:5.6.38-2.el6
mysql-community-libs-compat.x86_64 0:5.6.38-2.el6
mysql-community-server.x86_64 0:5.6.38-2.el6
Dependency Installed:
mysql-community-client.x86_64 0:5.6.38-2.el6
mysql-community-common.x86_64 0:5.6.38-2.el6
Replaced:
mysql-libs.x86_64 0:5.1.73-8.el6_8
Complete!
[root@heegw3o0cZ ~]# mysql -V
mysqlVer 14.14 Distrib 5.6.38, for Linux (x86_64) usingEditLine wrapper
[root@heegw3o0cZ ~]# /etc/init.d/mysqld start
Starting mysqld:[OK]
[root@heegw3o0cZ ~]# mysql
Welcome to the MySQL monitor.Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.38 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, 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|
+--------------------+
| information_schema |
| mysql|
| rt3|
+--------------------+
7 rows in set (0.00 sec)
mysql>
11-20
11-19
11-20
11-20
11-20
11-19
11-20
11-20
11-19
11-20
11-19
11-19
11-19
11-19
11-19
11-19