Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and upgrade MySQL 5.5.25 to 5.6.26 for RedHat Enterprise Linux 6.4

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to install and upgrade MySQL 5.5.25 to 5.6.26 for RedHat Enterprise Linux 6.4. the editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Step 1: preparatory work:

1. It is recommended to delete mysql users that exist in the system.

[root@mysql01 Desktop] # id mysql

Uid=27 (mysql) gid=27 (mysql) groups=27 (mysql)

[root@mysql01 Desktop] # userdel-r mysql

2. Clean up the installed mysql packages

[root@mysql01 Desktop] # service mysql status

[root@mysql01 Desktop] # service mysql stop

[root@mysql01 Desktop] # service mysql status

[root@mysql01 Desktop] # rpm-qa | grep mysql

Mysql-server-5.1.66-2.el6_3.x86_64

Dovecot-mysql-2.0.9-5.el6.x86_64

Qt-mysql-4.6.2-25.el6.x86_64

Rsyslog-mysql-5.8.10-6.el6.x86_64

Mysql-5.1.66-2.el6_3.x86_64

Mod_auth_mysql-3.0.0-11.el6_0.1.x86_64

Mysql-devel-5.1.66-2.el6_3.x86_64

Mysql-libs-5.1.66-2.el6_3.x86_64

Use the rpm-e package name (shown above) to clear the installation package. If you encounter an error that cannot be reported, you can not delete it, and add the parameter-- nodeps to force deletion.

For example:

[root@suzzy] # rpm-e qt-mysql-4.6.2-25.el6.x86_64

Error: Failed dependencies:

Qt4-mysql is needed by (installed) akonadi-1.2.1-2.el6.x86_64

[root@suzzy] # rpm-e qt-mysql-4.6.2-25.el6.x86_64-- nodeps

Rpm-e mysql-server-5.1.66-2.el6_3.x86_64-- nodeps

Rpm-e dovecot-mysql-2.0.9-5.el6.x86_64-- nodeps

Rpm-e qt-mysql-4.6.2-25.el6.x86_64-- nodeps

Rpm-e rsyslog-mysql-5.8.10-6.el6.x86_64-- nodeps

Rpm-e mysql-5.1.66-2.el6_3.x86_64-- nodeps

Rpm-e mod_auth_mysql-3.0.0-11.el6_0.1.x86_64-- nodeps

Rpm-e mysql-devel-5.1.66-2.el6_3.x86_64-- nodeps

Rpm-e mysql-libs-5.1.66-2.el6_3.x86_64-- nodeps

Until the mysql package is not found in the following statement

[root@mysql01 ~] # rpm-qa | grep mysql

Note: the configuration file / etc/my.cnf and the database file / var/lib/mysql need to be deleted after the uninstall is completed. For conservative reasons, the configuration file my.cnf can be renamed.

Step 2:

1. Check and install the required packages

[root@mysql01 ~] # rpm-qa | grep cmake

Cmake-2.6.4-5.el6.x86_64

[root@mysql01 ~] # rpm-qa | grep make

Cmake-2.6.4-5.el6.x86_64

Automake-1.11.1-4.el6.noarch

Imake-1.0.2-11.el6.x86_64

Make-3.81-20.el6.x86_64

Makebootfat-1.4-10.el6.x86_64

[root@mysql01 ~] # yum install gcc gcc-c++ autoconf automake bison* zlib* libxml* ncurses-devel libaio* make cmake-y / / if make is not installed in the additional test, the cmake package needs to be installed.

2. Install the libtool-ltdl-devel package (libtool-ltdl-devel-2.2.6-15.5.el6.i686.rpm, libtool-ltdl-devel-2.2.6-15.5.el6.x86_64.rpm)

[root@mysql01 ~] # cd/ misc/cd/Packages

[root@mysql01 Packages] # ls-l libtool-ltdl*

-Rafael, Rafe, Rafael. Root root 45660 Aug 17 2010 libtool-ltdl-2.2.6-15.5.el6.i686.rpm

-Rafael, Rafe, Rafael. 109 root root 45460 Aug 17 2010 libtool-ltdl-2.2.6-15.5.el6.x86_64.rpm

-Rafael, Rafe, Rafael. 37 root root 166264 Aug 17 2010 libtool-ltdl-devel-2.2.6-15.5.el6.i686.rpm

-Rafael, Rafe, Rafael. 34 root root 166248 Aug 17 2010 libtool-ltdl-devel-2.2.6-15.5.el6.x86_64.rpm

[root@mysql01 Packages] # rpm-ivh libtool-ltdl-2.2.6-15.5.el6.i686.rpm

Warning: libtool-ltdl-2.2.6-15.5.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

Preparing... # [100%]

1:libtool-ltdl # # [100%]

[root@mysql01 Packages] # rpm-ivh libtool-ltdl-devel-2.2.6-15.5.el6.i686.rpm / / install rpm-ivh libtool-ltdl-2.2.6-15.5.el6.i686.rpm before installing this package

Warning: libtool-ltdl-devel-2.2.6-15.5.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

Preparing... # [100%]

1:libtool-ltdl-devel # # [100%]

[root@mysql01 Packages] # rpm-ivh libtool-ltdl-devel-2.2.6-15.5.el6.i686.rpm

Warning: libtool-ltdl-devel-2.2.6-15.5.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

Preparing... # [100%]

1:libtool-ltdl-devel # # [100%]

Note:

When I see MySQL in many places, I use libtool-ltdl-devel*, to report the following error when installing using yum:

During the installation of MySQL, libtool-ltdl-devel-2.2.6-15.5.el6.x86_64.rpm can be installed in the rpm-ivh libtool-ltdl-devel-2.2.6-15.5.el6.x86_64.rpm mode

But there will be an error if you use yum install libtool-ltdl-devel*. If you want to install libtool-ltdl-devel-2.2.6-15.5.el6.i686.rpm together, you must install it first.

Libtool-ltdl-2.2.6-15.5.el6.i686.rpm package before you can install rpm-ivh libtool-ltdl-devel-2.2.6-15.5.el6.i686.rpm

The following is the error message:

[root@mysql01 ~] # yum install gcc gcc-c++ autoconf automake bison* zlib* libxml* ncurses-devel libaio* libtool-ltdl-devel* make cmake-y

Loaded plugins: aliases, changelog, downloadonly, kabi, presto, product-id, refresh-packagekit, security, subscription-manager, tmprepo

: verify, versionlock

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Loading support for Red Hat kernel ABI

Setting up Install Process

Package gcc-4.4.7-3.el6.x86_64 already installed and latest version

Package gcc-c++-4.4.7-3.el6.x86_64 already installed and latest version

....

Package ncurses-devel-5.7-3.20090208.el6.x86_64 already installed and latest version

No package libtool-ltdl-devel* available.

Package 1:make-3.81-20.el6.x86_64 already installed and latest version

...

Even if you install using the following installation method, you will report an error:

[root@mysql01 ~] # yum install libtool-ltdl-devel*-y

Loaded plugins: aliases, changelog, downloadonly, kabi, presto, product-id, refresh-packagekit

: security, subscription-manager, tmprepo, verify, versionlock

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Loading support for Red Hat kernel ABI

Setting up Install Process

No package libtool-ltdl-devel* available.

Error: Nothing to do

[root@mysql01] # yum install libtool-ltdl-devel-2.2.6-15.5.el6.i686*-y

Loaded plugins: aliases, changelog, downloadonly, kabi, presto, product-id, refresh-packagekit, security, subscription-manager, tmprepo

: verify, versionlock

This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Loading support for Red Hat kernel ABI

Setting up Install Process

No package libtool-ltdl-devel-2.2.6-15.5.el6.i686 * available.

Error: Nothing to do

[root@mysql01] # rpm-ivh / misc/cd/Packages/libtool-ltdl-devel-2.2.6-15.5.el6.i686.rpm

Warning: / misc/cd/Packages/libtool-ltdl-devel-2.2.6-15.5.el6.i686.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

Error: Failed dependencies:

Libltdl.so.7 is needed by libtool-ltdl-devel-2.2.6-15.5.el6.i686

3. Set up user groups and users

[root@mysql01 ~] # groupadd mysql

[root@mysql01 ~] # useradd-g mysql mysql

4. Set operating system resource limit

[root@mysql01 ~] # vi / etc/security/limits.conf / / add the following at the end of the configuration file

Mysql soft nproc 2047

Mysql hard nproc 16384

Mysql soft nofile 1024

Mysql hard nofile 65536

5. Upload the downloaded rpm package of mysql program to the server

Skip here

6. Create the installation directory and database storage directory of mysql and set permissions

[root@mysql01] # mkdir-p / usr/local/mysql

[root@mysql01] # mkdir-p / usr/local/mysql/data

[root@mysql01] # chown-R mysql:mysql / usr/local/mysql/

7. Decompress and upload mysql source files

[root@mysql01 ~] # cd Desktop

[root@mysql01 Desktop] # tar-xzvf mysql-5.6.25.tar.gz-C / usr/local/mysql

[root@mysql01 Desktop] # chown-R mysql:mysql / usr/local/mysql/

8. Execute the cmake command to generate the compiled configuration file

[root@mysql01 ~] # cd / usr/local/mysql/mysql-5.6.25/

[root@mysql01 mysql-5.6.25] # cmake. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql\

-DINSTALL_DATADIR=/usr/local/mysql/data\

-DDEFAULT_CHARSET=utf8\

-DDEFAULT_COLLATION=utf8_general_ci\

-DEXTRA_CHARSETS=all\

-DENABLED_LOCAL_INFILE=1\

-DMYSQL_USER=mysql\

-DMYSQL_TCP_PORT=3306\

-DWITH_INNOBASE_STORAGE_ENGINE=1\

-DWITH_READLINE=1

[root@mysql01 mysql-5.6.25] # make & & make install

Note:

1, this compilation and installation process is slow, may take about 5-10 minutes, we need to wait patiently.

2. CMAKE parameter description:

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql / / default installation directory

-DINSTALL_DATADIR=/usr/local/mysql/data / / database storage directory

-DDEFAULT_CHARSET=utf8 / / use utf8 characters

-DDEFAULT_COLLATION=utf8_general_ci / / check character

-DEXTRA_CHARSETS=all / / install all extended character sets

-DENABLED_LOCAL_INFILE=1 / / allow data to be imported locally

-DMYSQL_USER=mysql

-DMYSQL_TCP_PORT=3306

Note:

If the installation fails to recompile, you need to clear the old object files and cache information.

Shell > make clean

Shell > rm-f CMakeCache.txt

Shell > rm-rf / etc/my.cnf

9. Set up the tables for booting automatically and creating the system database

[root@mysql01 ~] # cp / usr/local/mysql/mysql-5.6.25/support-files/my-default.cnf / etc/my.cnf

[root@mysql01 ~] # cp / usr/local/mysql/mysql-5.6.25/support-files/mysql.server / etc/rc.d/init.d/mysql / / add mysql startup service to the system service

10. Install the mysql database:

[root@mysql01 ~] # chmod + x / usr/local/mysql/mysql-5.6.25/scripts/mysql_install_db*

[root@mysql01] # / usr/local/mysql/mysql-5.6.25/scripts/mysql_install_db-basedir=/usr/local/mysql-datadir=/usr/local/mysql/data-user=mysql

Or:

[root@mysql01] # / usr/local/mysql/mysql-5.6.25/scripts/mysql_install_db.sh-basedir=/usr/local/mysql-datadir=/usr/local/mysql/data-user=mysql

Or:

[root@mysql01 scripts] # / mysql_install_db-- basedir=/usr/local/mysql-- datadir=/usr/local/mysql/data-- user=mysql

Installing MySQL system tables...2016-01-12 14:16:46 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details).

2016-01-12 14:16:46 0 [Note] / usr/local/mysql/bin/mysqld (mysqld 5.6.25) starting as process 4236.

2016-01-12 14:16:46 4236 [Note] InnoDB: Using atomics to ref count buffer pool pages

2016-01-12 14:16:46 4236 [Note] InnoDB: The InnoDB memory heap is disabled

2016-01-12 14:16:46 4236 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2016-01-12 14:16:46 4236 [Note] InnoDB: Memory barrier is not used

2016-01-12 14:16:46 4236 [Note] InnoDB: Compressed tables use zlib 1.2.3

2016-01-12 14:16:46 4236 [Note] InnoDB: Using Linux native AIO

2016-01-12 14:16:46 4236 [Note] InnoDB: Using CPU crc32 instructions

2016-01-12 14:16:46 4236 [Note] InnoDB: Initializing buffer pool, size = 128.0m

2016-01-12 14:16:46 4236 [Note] InnoDB: Completed initialization of buffer pool

2016-01-12 14:16:46 4236 [Note] InnoDB: The first specified data file. / ibdata1 did not exist: a new database to be created!

2016-01-12 14:16:46 4236 [Note] InnoDB: Setting file. / ibdata1 size to 12 MB

2016-01-12 14:16:46 4236 [Note] InnoDB: Database physically writes the file full: wait...

2016-01-12 14:16:46 4236 [Note] InnoDB: Setting logfile. / ib_logfile101 size to 48 MB

2016-01-12 14:16:47 4236 [Note] InnoDB: Setting logfile. / ib_logfile1 size to 48 MB

2016-01-12 14:16:48 4236 [Note] InnoDB: Renaming logfile. / ib_logfile101 to. / ib_logfile0

2016-01-12 14:16:48 4236 [Warning] InnoDB: New log files created, LSN=45781

2016-01-12 14:16:48 4236 [Note] InnoDB: Doublewrite buffer not found: creating new

2016-01-12 14:16:48 4236 [Note] InnoDB: Doublewrite buffer created

2016-01-12 14:16:48 4236 [Note] InnoDB: 128rollback segment (s) are active.

2016-01-12 14:16:48 4236 [Warning] InnoDB: Creating foreign key constraint system tables.

2016-01-12 14:16:48 4236 [Note] InnoDB: Foreign key constraint system tables created

2016-01-12 14:16:48 4236 [Note] InnoDB: Creating tablespace and datafile system tables.

2016-01-12 14:16:48 4236 [Note] InnoDB: Tablespace and datafile system tables created.

2016-01-12 14:16:48 4236 [Note] InnoDB: Waiting for purge to start

2016-01-12 14:16:48 4236 [Note] InnoDB: 5.6.25 started; log sequence number 0

2016-01-12 14:16:49 4236 [Note] Binlog end

2016-01-12 14:16:49 4236 [Note] InnoDB: FTS optimize thread exiting.

2016-01-12 14:16:49 4236 [Note] InnoDB: Starting shutdown...

2016-01-12 14:16:51 4236 [Note] InnoDB: Shutdown completed; log sequence number 1625977

OK

Filling help tables...2016-01-12 14:16:51 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details).

2016-01-12 14:16:51 0 [Note] / usr/local/mysql/bin/mysqld (mysqld 5.6.25) starting as process 4260.

2016-01-12 14:16:51 4260 [Note] InnoDB: Using atomics to ref count buffer pool pages

2016-01-12 14:16:51 4260 [Note] InnoDB: The InnoDB memory heap is disabled

2016-01-12 14:16:51 4260 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2016-01-12 14:16:51 4260 [Note] InnoDB: Memory barrier is not used

2016-01-12 14:16:51 4260 [Note] InnoDB: Compressed tables use zlib 1.2.3

2016-01-12 14:16:51 4260 [Note] InnoDB: Using Linux native AIO

2016-01-12 14:16:51 4260 [Note] InnoDB: Using CPU crc32 instructions

2016-01-12 14:16:51 4260 [Note] InnoDB: Initializing buffer pool, size = 128.0m

2016-01-12 14:16:51 4260 [Note] InnoDB: Completed initialization of buffer pool

2016-01-12 14:16:51 4260 [Note] InnoDB: Highest supported file format is Barracuda.

2016-01-12 14:16:51 4260 [Note] InnoDB: 128rollback segment (s) are active.

2016-01-12 14:16:51 4260 [Note] InnoDB: Waiting for purge to start

2016-01-12 14:16:51 4260 [Note] InnoDB: 5.6.25 started; log sequence number 1625977

2016-01-12 14:16:51 4260 [Note] Binlog end

2016-01-12 14:16:51 4260 [Note] InnoDB: FTS optimize thread exiting.

2016-01-12 14:16:51 4260 [Note] InnoDB: Starting shutdown...

2016-01-12 14:16:53 4260 [Note] InnoDB: Shutdown completed; log sequence number 1625987

OK

To start mysqld at boot time you have to copy

Support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER!

To do so, start the server, then issue the following commands:

/ usr/local/mysql/bin/mysqladmin-u root password' new-password'

/ usr/local/mysql/bin/mysqladmin-u root-h mysql01 password' new-password'

Alternatively you can run:

/ usr/local/mysql/bin/mysql_secure_installation

Which will also give you the option of removing the test

Databases and anonymous user created by default. This is

Strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

Cd. ; / usr/local/mysql/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

Cd mysql-test; perl mysql-test-run.pl

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/local/mysql/my.cnf and

Will be used by default by the server when you start it.

You may edit this file to change server settings

WARNING: Default config file / etc/my.cnf exists on the system

This file will be read by default by the MySQL server

If you do not want to use this, either remove it, or use the

-- defaults-file argument to mysqld_safe when starting the server

11. Start the mysql database and set the boot to start automatically:

[root@mysql01 ~] # service mysql start

Env: / etc/init.d/mysql: Permission denied

[root@mysql01 ~] # ls-l / etc/init.d/mysql

-rw-r--r--. 1 root root 10880 Aug 28 21:24 / etc/init.d/mysql

[root@mysql01 ~] # chmod 755 / etc/init.d/mysql

[root@mysql01 ~] # ls-l / etc/init.d/mysql

-rwxr-xr-x. 1 root root 10880 Aug 28 21:24 / etc/init.d/mysql

[root@mysql01 ~] # service mysql status

MySQL is not running [FAILED]

[root@mysql01 ~] # service mysql start

Starting MySQL.. [OK]

[root@mysql01 Desktop] # chkconfig-- list | grep mysql

[root@mysql01 Desktop] # chkconfig-- level 2345 mysql on

[root@mysql01 Desktop] # chkconfig-- list | grep mysql

Mysql 0:off 1:off 2:on 3:on 4:on 5:on 6:off

12. Add mysql startup service to the system service

[root@mysql01 ~] # vi / root/.bash_profile

PATH=$PATH:$HOME/bin:/usr/local/mysql/bin:/usr/local/mysql/lib

[root@mysql01 ~] # source / root/.bash_profile

Or:

[root@mysql01] #. .bash _ profile

13. Login test:

[root@mysql01] # mysql-uroot-p

Enter password: / / password is empty

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 1

Server version: 5.6.25 Source distribution

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 > set password for root@'localhost'=password ("666666")

Query OK, 0 rows affected (0.04 sec)

Mysql > show databases

+-+

| | Database |

+-+

| | information_schema |

| | mysql |

| | performance_schema |

| | t |

+-+

4 rows in set (0.03 sec)

Mysql > select user,host from mysql.user order by user

+-+ +

| | user | host |

+-+ +

| | localhost |

| | mysql01 |

| | root | localhost |

| | root | mysql01 |

| | root | 127.0.0.1 | |

| | root |:: 1 |

+-+ +

6 rows in set (0.01 sec)

Mysql > exit

Bye

[root@mysql01] # mysql-uroot-p

Enter password:666666

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 2

Server version: 5.6.25 Source distribution

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 |

| | mysq |

| | performance_schema |

| | test |

+-+

4 rows in set (0.00 sec)

This is the end of the article on "how to install and upgrade MySQL 5.5.25 to 5.6.26 for RedHat Enterprise Linux 6.4". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report