centos6安装mysql5.6.19,升级到5.6.46

以下为在root用户下安装mysql5.6.19,然后升级到5.6.48的过程,在root下操作非常简单,且都是5.6系列只要简单执行rpm -ivh进行安装,rpm -Uvh 进行升级既可,5.6只需要安装client包和service。mysql5.7系列和非root下的安装、升级,后续会说到。

软件下载地址:https://downloads.mysql.com/archives/community/

 

软件下载地址2:http://ftp.ntu.edu.tw/MySQL/Downloads/

地址2下载时注意版本,el6代表redhat6系列,el7代表redhat7系列。

[root@localhost soft_rpm]# rpm -qa|grep -i mara*  #有就卸载
[root@localhost soft_rpm]# rpm -qa|grep -i mysql  #有就卸载
mysql-libs-5.1.73-8.el6_8.x86_64
[root@localhost soft_rpm]# rpm -e mysql-libs-5.1.73-8.el6_8.x86_64 --nodeps 
[root@localhost mysql5.6.19]# ls
MySQL-5.6.19-1.el6.x86_64.rpm-bundle.tar
[root@localhost mysql5.6.19]# tar -xf MySQL-5.6.19-1.el6.x86_64.rpm-bundle.tar

[root@localhost mysql5.6.19]# rpm -ivh MySQL-server-5.6.19-1.el6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-server           ########################################### [100%]
   .....................
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER ! #注意这两句话,告诉你默认密码放在哪
You will find that password in '/root/.mysql_secret'.

You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.

Also, the account for the anonymous user has been removed.

In addition, you can run:

  /usr/bin/mysql_secure_installation

which will also give you the option of removing the test database.
This is strongly recommended for production servers.

See the manual for more instructions.

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

[root@localhost mysql5.6.19]# rpm -ivh MySQL-client-5.6.19-1.el6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-client           ########################################### [100%]
   
[root@localhost init.d]# service mysql start
Starting MySQL.. SUCCESS!
[root@localhost mysql5.6.19]# cat /root/.mysql_secret
# The random password set for the root user at Tue Dec  3 10:30:44 2019 (local time): HWwdfKQHfkRRCsGn
mysql> set password for root@localhost=password('root');
Query OK, 0 rows affected (0.00 sec)
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.6.19    |
+-----------+
1 row in set (0.02 sec)

[root@localhost mysql5.6.19]# service mysql stop
Shutting down MySQL.. SUCCESS!

[root@localhost mysql5.6.46]# tar -xf MySQL-5.6.46-1.el6.x86_64.rpm-bundle.tar
[root@localhost mysql5.6.46]# ls
MySQL-5.6.46-1.el6.x86_64.rpm-bundle.tar  MySQL-devel-5.6.46-1.el6.x86_64.rpm     MySQL-server-5.6.46-1.el6.x86_64.rpm  MySQL-shared-compat-5.6.46-1.el6.x86_64.rpm
MySQL-client-5.6.46-1.el6.x86_64.rpm      MySQL-embedded-5.6.46-1.el6.x86_64.rpm  MySQL-shared-5.6.46-1.el6.x86_64.rpm  MySQL-test-5.6.46-1.el6.x86_64.rpm
[root@localhost mysql5.6.46]# rpm -Uvh MySQL-server-5.6.46-1.el6.x86_64.rpm
[root@localhost mysql5.6.46]# rpm -Uvh MySQL-client-5.6.46-1.el6.x86_64.rpm

[root@localhost mysql5.6.46]# mysql_upgrade -uroot -proot -s


[root@localhost init.d]# service mysql start
Starting MySQL.. SUCCESS!

[root@localhost init.d]# mysql -uroot -proot
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.6.46    |
+-----------+
1 row in set (0.00 sec)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值