服务器上Mysql的版本为:社区版的mysql-community-server-5.6.14。近日局方对服务器进行漏洞扫描,发现zhyh08上的mysql存在几个高危漏洞,要求进行修复。受这几个漏洞影响的主要是5.6.17及以前的版本,所以将mysql升级至最新的5.6.25即可解决问题。
1、下载最新的mysql安装包(rpm文件),链接如下:
MySQL-5.6.25-1.el6.x86_64.rpm-bundle.tar
2、备份数据库数据,这里使用的是mysqldump命令。
3、备份/etc/my.cnf:cp /etc/my.cnf /etc/my.cnf_backup
3、停止mysql服务:service mysql stop
4、解压上面的tar包:tar -xvf MySQL-5.6.25-1.el6.x86_64.rpm-bundle.tar
5、确认服务器上所安装的mysql的各个组件,这里我们只升级server和client。
[hadoop@zlyh08 chx]$ rpm -qa|grep -i mysql mysql-community-libs-compat-5.6.14-3.el6.x86_64 mysql-community-devel-5.6.14-3.el6.x86_64 mysql-community-common-5.6.14-3.el6.x86_64 mysql-community-libs-5.6.14-3.el6.x86_64 mysql-community-server-5.6.14-3.el6.x86_64 mysql-community-client-5.6.14-3.el6.x86_64 perl-DBD-MySQL-4.013-3.el6.x86_64 [hadoop@zlyh08 chx]$
6、将server和client卸载:
rpm -e mysql-community-server-5.6.14-3.el6.x86_64 rpm -e mysql-community-client-5.6.14-3.el6.x86_64
注:如若不先卸载的话,安装时会报文件冲突:
[root@zlyh08 chx]# rpm -Uvh MySQL-server-5.6.25-1.el6.x86_64.rpm Preparing... ########################################### [100%] file /usr/share/mysql/bulgarian/errmsg.sys from install of MySQL-server-5.6.25-1.el6.x86_64 conflicts with file from package mysql-community-common-5.6.14-3.el6.x86_64 ………… file /usr/share/mysql/french/errmsg.sys from install of MySQL-server-5.6.25-1.el6.x86_64 conflicts with file from package mysql-community-common-5.6.14-3.el6.x86_64
7、重新安装server和client:
[root@zlyh08 chx]# rpm -ivh MySQL-server-5.6.25-1.el6.x86_64.rpm Preparing... ########################################### [100%] 1:MySQL-server ########################################### [100%] 2015-07-01 16:02:40 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2015-07-01 16:02:40 0 [Note] /usr/sbin/mysqld (mysqld 5.6.25) starting as process 28611 ... 2015-07-01 16:02:40 28611 [Note] InnoDB: Using atomics to ref count buffer pool pages 2015-07-01 16:02:40 28611 [Note] InnoDB: The InnoDB memory heap is disabled ………… 2015-07-01 16:02:44 28633 [Note] InnoDB: FTS optimize thread exiting. 2015-07-01 16:02:44 28633 [Note] InnoDB: Starting shutdown... 2015-07-01 16:02:45 28633 [Note] InnoDB: Shutdown completed; log sequence number 1625987 A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER ! You will find that password in '/root/.mysql_secret'.#竟然没发现这一行,难怪装完一直连不上 ---------- [root@appserver ~]# cat /root/.mysql_secret # The random password set for the root user at Thu Nov 20 15:52:02 2014 (local time): sFpJCf6WLhyYKc35 ---------- 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@zlyh08 chx]# rpm -ivh MySQL-client-5.6.25-1.el6.x86_64.rpm Preparing... ########################################### [100%] 1:MySQL-client ########################################### [100%] [root@zlyh08 chx]#
8、恢复my.cnf:cp /etc/my.cnf_backup /etc/my.cnf
9、启动mysql服务:service mysql start
[root@zlyh08 chx]# service mysql start Starting MySQL... SUCCESS!
10、使用客户端连接mysql:
[root@zlyh08 mysql-5.6.25]# mysql ERROR 2002 (HY000): Can t connect to local MySQL server through socket '/data1/mysql/mysql.sock' (2)
11、查看/data1/mysql目录下,确实没有mysql.sock文件。
12、查看/etc/my.cnf文件,发现只在[mysql]下面配置了
[mysql] socket=/data1/mysql/mysql.sock default-character-set=utf8 [mysqld] #mysqld下面没有配置socket #skip-grant-tables interactive_timeout=300 wait_timeout=300
13、编辑/etc/my.cnf,在[mysqld]下面添加socket的配置,使用服务器和客户端都使用同一个socket文件,如下:
[mysql] socket=/data1/mysql/mysql.sock default-character-set=utf8 [mysqld] #skip-grant-tables socket=/data1/mysql/mysql.sock #增加此行,之前只[mysql]加了这一项 interactive_timeout=300 wait_timeout=300
14、重启mysql服务。
15、使用升级前的root用户连接mysql:
[hadoop@zlyh08 report_script]$ mysql -hzlyh08 -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 233 Server version: 5.6.25 MySQL Community Server (GPL) Copyright (c) 2000, 2015, 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 | | apollo_v1.0 | | hive | | log | | metastore | | mysql | | oozie | | performance_schema | | test | +--------------------+ 9 rows in set (0.00 sec) mysql>
16、至此,升级完成。
以上所述是小编给大家介绍的Mysql从5.6.14安全升级至mysql5.6.25的方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线
暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。
艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。
《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。
更新动态
- 凤飞飞《我们的主题曲》飞跃制作[正版原抓WAV+CUE]
- 刘嘉亮《亮情歌2》[WAV+CUE][1G]
- 红馆40·谭咏麟《歌者恋歌浓情30年演唱会》3CD[低速原抓WAV+CUE][1.8G]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[320K/MP3][193.25MB]
- 【轻音乐】曼托凡尼乐团《精选辑》2CD.1998[FLAC+CUE整轨]
- 邝美云《心中有爱》1989年香港DMIJP版1MTO东芝首版[WAV+CUE]
- 群星《情叹-发烧女声DSD》天籁女声发烧碟[WAV+CUE]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[FLAC/分轨][748.03MB]
- 理想混蛋《Origin Sessions》[320K/MP3][37.47MB]
- 公馆青少年《我其实一点都不酷》[320K/MP3][78.78MB]
- 群星《情叹-发烧男声DSD》最值得珍藏的完美男声[WAV+CUE]
- 群星《国韵飘香·贵妃醉酒HQCD黑胶王》2CD[WAV]
- 卫兰《DAUGHTER》【低速原抓WAV+CUE】
- 公馆青少年《我其实一点都不酷》[FLAC/分轨][398.22MB]
- ZWEI《迟暮的花 (Explicit)》[320K/MP3][57.16MB]