The version of MySQL on the server is: Community version of mysql-community-server-5.6.14. Recently, the Bureau of the server for vulnerability scanning, found that the MySQL zhyh08 on several high-risk vulnerabilities, the requirements for repair. Affected by these vulnerabilities are mainly 5.6.17 and previous versions, so the MySQL upgrade to the latest 5.6.25 can solve the problem.
1, download the latest MySQL installation package (rpm file), links are as follows:
Mysql-5.6.25-1.el6.x86_64.rpm-bundle.tar
2, back up the database data, where the use of the mysqldump command.
3, Backup/etc/my.cnf:cp/etc/my.cnf/etc/my.cnf_backup
3, stop MySQL services: service MySQL Stop
4, extract the above tar bag: tar-xvf Mysql-5.6.25-1.el6.x86_64.rpm-bundle.tar
5, the server to confirm the installation of the various components of MySQL, here we only upgrade server and 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
6. Uninstall Server and 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
Note: If you do not uninstall first, the installation will report file conflicts:
[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 the file from package mysql-community-common-5.6.14-3.el6.x86_64
..... File/usr/share/mysql/french/errmsg.sys from install to 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. Reinstall Server and 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 (the 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] Inn
Odb: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'll find this password in '/root/.mysql_secret '. #竟然没发现这一行, it's no wonder you can't even----------at all.Root@appserver ~]# Cat/root/.mysql_secret # The random password set for "root" at Thu Nov-15:52:02 (Local Time): Sfpjcf6wlhyykc35----------Your must change is password on your The I connect, no other statement but ' SET passwo
RD ' 'll be accepted.
The manual for the semantics of the ' password expired ' flag.
Also, the account for the anonymous user has been removed. In addition, can run:/usr/bin/mysql_secure_installation which'll also give you the option of removing the test data
Base.
This is strongly recommended for production servers.
The manual for more instructions. Please have a problems at Http://bugs.mysql.com/The latest information about MySQL are available on the Web at http:// www.mysql.com Support MySQL by buying support/licenses at http://shop.mysql.com New Default Config file is created As/us
R/MY.CNF and'll are used by default to the server when you start it. You could edit this file to the change server settings [root@zlyh08 chx]# RPM-IVHmysql-client-5.6.25-1.el6.x86_64.rpm preparing ... ########################################### [100%] 1: Mysql-client ########################################### [100%] [root@zlyh08 chx]#
8, restore MY.CNF:CP/ETC/MY.CNF_BACKUP/ETC/MY.CNF
9, start MySQL services: service MySQL Start
[root@zlyh08 chx]# service MySQL start
starting mysql ... success!
10. Use client to connect MySQL:
[root@zlyh08 mysql-5.6.25]# MySQL
ERROR 2002 (HY000): Can t connect to the local MySQL server through socket '/data1/mysql /mysql.sock ' (2)
11, look at the/data1/mysql directory, there is no Mysql.sock file.
12, view the/etc/my.cnf file, found only in [MySQL] under the configuration of
[MySQL]
Socket=/data1/mysql/mysql.sock
Default-character-set=utf8
[mysqld] #mysqld下面没有配置socket
# Skip-grant-tables
interactive_timeout=300
wait_timeout=300
13, edit/etc/my.cnf, under [mysqld] Add socket configuration, using the server and the client use the same socket file, as follows:
[MySQL]
Socket=/data1/mysql/mysql.sock
Default-character-set=utf8
[mysqld]
#skip-grant-tables
socket=/ Data1/mysql/mysql.sock #增加此行, previously only [MySQL] added this
interactive_timeout=300
wait_timeout=300
14, restart the MySQL service.
15, using the root user before the upgrade to connect 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), 2015, Orac Le and/or its affiliates. All rights reserved.
Oracle is a registered trademark to Oracle Corporation and/or its
affiliates. The other names may is 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, at this point, upgrade completed.
The above is a small set to introduce the MySQL from 5.6.14 security upgrade to mysql5.6.25 method, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!