centos升级MySQL数据库5.6.39

MySQL数据库升级3.6.39

准备工作:
1.新建目录(把升级文件放在此目录中)
[[email protected] /]# mkdir /mysqlbak
[[email protected] /]#
2.上传升级的数据库版本:
.https://cdn.mysql.com//Downloads/MySQL-5.6/MySQL-5.6.39-1.el7.x86_64.rpm-bundle.tar

3.解压
[[email protected] mysqlbak]# tar vxf MySQL-5.6.39-1.el7.x86_64.rpm-bundle.tar
MySQL-shared-compat-5.6.39-1.el7.x86_64.rpm
MySQL-client-5.6.39-1.el7.x86_64.rpm
MySQL-devel-5.6.39-1.el7.x86_64.rpm
MySQL-server-5.6.39-1.el7.x86_64.rpm
MySQL-shared-5.6.39-1.el7.x86_64.rpm
MySQL-test-5.6.39-1.el7.x86_64.rpm
MySQL-embedded-5.6.39-1.el7.x86_64.rpm

备份数据库
注:升级数据库理论是不影响数据的,安全起见备份数据库
[[email protected] /]# mysqldump -uroot -P 3306 -p -A > /mysqlbak/dabatases.sql
Enter password:
You have new mail in /var/spool/mail/root
[[email protected] /]#

停止数据库
[[email protected] mysqlbak]# service crond stop
Redirecting to /bin/systemctl stop crond.service
You have new mail in /var/spool/mail/root
[[email protected] mysqlbak]# service mysql stop
Shutting down MySQL..................... SUCCESS!
[[email protected] mysqlbak]# netstat -lntup | grep 3306
[[email protected] mysqlbak]#

删除旧版本MySQL包文件
[[email protected] mysqlbak]# yum remove MySQL-share MySQL-client MySQL-devel MySQL-server MySQL-shared

安装新的MySQL包文件
[[email protected] mysqlbak]# rpm -ivh MySQL-client-5.6.39-1.el7.x86_64.rpm
warning: MySQL-client-5.6.39-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-client-5.6.39-1.el7 ################################# [100%]
[[email protected] mysqlbak]# rpm -ivh MySQL-devel-5.6.39-1.el7.x86_64.rpm
warning: MySQL-devel-5.6.39-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-devel-5.6.39-1.el7 ################################# [100%]
[[email protected] mysqlbak]# rpm -ivh MySQL-embedded-5.6.39-1.el7.x86_64.rpm
warning: MySQL-embedded-5.6.39-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-embedded-5.6.39-1.el7 ################################# [100%]
[[email protected] mysqlbak]# rpm -ivh MySQL-shared-5.6.39-1.el7.x86_64.rpm
warning: MySQL-shared-5.6.39-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-shared-5.6.39-1.el7 ################################# [100%]
[[email protected] mysqlbak]# rpm -ivh MySQL-shared-compat-5.6.39-1.el7.x86_64.rpm
warning: MySQL-shared-compat-5.6.39-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-shared-compat-5.6.39-1.el7 ################################# [100%]
[[email protected] mysqlbak]# rpm -ivh MySQL-test-5.6.39-1.el7.x86_64.rpm
warning: MySQL-test-5.6.39-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-test-5.6.39-1.el7 ################################# [100%]
[[email protected] mysqlbak]# rpm -ivh MySQL-server-5.6.39-1.el7.x86_64.rpm
warning: MySQL-server-5.6.39-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ################################# [100%]
Updating / installing...
1:MySQL-server-5.6.39-1.el7 ################################# [100%]

登陆升级后MySQL
[[email protected] hy]# /etc/init.d/mysql start
Starting MySQL....... SUCCESS!
[[email protected] hy]# mysql -uroot -pBjqdsc402
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 8
Server version: 5.6.39 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, 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 +--------------------+ mysql performance_schema test

+--------------------+
7 rows in set (0.05 sec)

mysql>select version();
+-----------+
| version() |
+-----------+
| 5.6.39 |
+-----------+
1 row in set (0.08 sec)

mysql>

原文地址:http://blog.51cto.com/891023/2093071

时间: 2024-10-03 04:52:35

centos升级MySQL数据库5.6.39的相关文章

Centos 升级MySQL版本或者Yum安装Mysql5.6

Centos 升级MySQL版本或者Yum安装Mysql5.6 1.从MySQL Yum仓库下载最新的rpm文件:http://dev.mysql.com/downloads/repo/yum/CentOS 6 http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm 2.yum remove mysql mysql-* 3.mysql-community-release-el6-5.noarch.rpm 4.yum local

CentOS 更改MySQL数据库目录位置

CentOS 更改MySQL数据库目录位置 由于MYSQL的数据库太大,默认安装的“/var”盘已经再也无法容纳新增加的数据,没有办法,只能想办法转移数据的目录. 以下是将MYSQL数据库默认安装目录从“/var/lig/mysql”目录转移到“/home/mysql_data/”目录具体操作流程: 通过用”YUM”安装“MYSQL”数据库,安装目录为默认路径:”/var/lib/mysql” 启动“MYSQL”数据库 [[email protected] ~]#service mysqld s

centos下mysql 数据库安装、调试

博主是一个linux的初学者,决定记录学习过程中的点滴,当做一个成长记录也好,当做后来人学习的参考也罢,总之,博客就在那里,我们各取所需,只是不要让他孤独就好. 首先,持久化数据是一个程序必备的模块,恰逢博主的项目中也需要在centos操作系统上部署,所以就以安装mysql数据库开始吧.可能你觉得内容比较简单,但无所谓吧,会者谓之简单:不会者谓之难.博主只求用最简单的描述,满足“不会者”的好学. 主要分为两种方式,一种是下载安装包,然后安装:一种是通过yum命令.博主觉得通过yum命令比较简单,

CentOS下MySQL数据库安装

前辈们总是说,要边学边记录,要总结.所以,开始把每天学到的内容一点一点记录. 复杂的理论不懂,只会目前安装,安好后就开始玩咯! 1.在官网下载相应的rpm安装包 下载地址:http://dev.mysql.com/downloads/mysql/5.6.html#downloads 比如:我只下载了这三个. 2.鄙人就用rpm命令安装(相对较熟悉) 其实,这是应该是第3步 #rpm -ivh MySQL-client-5.6.19-1.el6.i686.rpm #rpm -ivh MySQL-d

centos升级mysql至5.7

1.备份原数据库 [[email protected] ~] #mysqldump -u root –p -E –all-database > /home/db-backup.sql 加-E是因为mysqldump默认并不处理mysql的事件,需要自己指明是否导出事件. copy一份my.cnf,待安装mysql5.7的时候参照. [[email protected] ~]# cp /etc/my.cnf /home/my.cnf 停止mysql服务 [[email protected] ~]#

CentOS下MYSQL数据库的安装

关于在Centos系统下安装MYSQL数据库,网络上资料有很多,在此主要感谢该文章的博主:http://www.cnblogs.com/zhoulf/archive/2013/01/25/zhoulf.html,因为相对来说,该篇文章具有很强的操作性.此文将在汇集众多资料的基础上,记录本人安装MYSQL的全过程. 一.配置环境与软件版本: 1.Centos版本:6.3版32位系统: 2.CMake版本:cmake-2.8.4.tar.gz: 3.Mysql版本:mysql-5.5.11.tar.

phpstudy升级mysql数据库

因为MySQL支持全文索引的只有5.6以上,而我下的phpstudy只有5.5的版本,在导入数据库的时候因为该数据库的表内有使用全文索引,因此必须升级phpstudy的mysql版本,这里就把自己当升级过程详细记录和总结一下. 首先查看phpstudy的mysql版本: 方法一  使用mysql的version函数: select     version(); 方法二  status命令 status; 如果不想登陆mysql进行查询可以使用mysql -v和mysql --help,这里不详述

centos中Mysql数据库导入sql文件

1.对于文件的导入,在Centos下里面的是首先要新建一个和文件相同名字的数据库. mysql>create database Student; 2.切换到需要导入sql文件的数据库 mysql> use Student; 3.如果没有错误的话,说明进入了你新建的数据库中.然后把先设置编码: mysql>set names utf8; 4.接着输入你所导入到Centos下的数据库文Student.sql文件的位置 mysql>source /usr/database.sql; 文件

CentOS修改MySql数据库目录datadir

service mysqld stop        //停止mysql服务 cp -rf /var/lib/mysql /home/data     //复制默认的mysql数据库目录 chown -R mysql:mysql /home/data   //给新的目录授权 //修改my.cnf, 为确保没问题, 可以将以前的配置注释掉或者cp一份 vi /etc/my.cnf datadir=/home/data socket=/home/data/mysql.sock //修改mysqld