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

MySQL 5.5.25 how to install and upgrade to 5.6.26 for RedHat Enterprise Linux 6.4 using tar

2025-02-22 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 MySQL 5.5.25 uses tar to install and upgrade 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@suzzy ~] # 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: start the installation

1. Set up user groups and users

[root@mysql01 ~] # groupadd mysql

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

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

Skip here

3. Extract the mysql package

[root@mysql01 Desktop] # unzip V76366-01.zip

[root@mysql01 Desktop] # tar-zxvf mysql-advanced-5.6.22-linux-glibc2.5-x86_64.tar.gz

4. Move the extracted folder to / usr/local and rename it to mysql

[root@mysql01 Desktop] # mv mysql-advanced-5.6.25-linux-glibc2.5-x86_64 / usr/local/mysql

5. Establish mysql group, establish mysql user and join mysql group

[root@mysql01 Desktop] # groupadd mysql

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

6. Copy my-default.cnf to my.cnf

[root@mysql01 Desktop] # cp / usr/share/mysql/my-default.cnf / etc/my.cnf

7. Initially test the table and specify that mysql users be used to access the

[root@mysql01 Desktop] # cd / usr/local/mysql

[root@mysql01 mysql] #. / scripts/mysql_install_db-user=mysql

Installing MySQL system tables...2015-08-28 18:20:22 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details).

2015-08-28 18:20:22 0 [Note]. / bin/mysqld (mysqld 5.6.25-enterprise-commercial-advanced) starting as process 10702.

2015-08-28 18:20:22 10702 [Note] InnoDB: Using atomics to ref count buffer pool pages

2015-08-28 18:20:22 10702 [Note] InnoDB: The InnoDB memory heap is disabled

2015-08-28 18:20:22 10702 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2015-08-28 18:20:22 10702 [Note] InnoDB: Memory barrier is not used

2015-08-28 18:20:22 10702 [Note] InnoDB: Compressed tables use zlib 1.2.3

2015-08-28 18:20:22 10702 [Note] InnoDB: Using Linux native AIO

2015-08-28 18:20:22 10702 [Note] InnoDB: Using CPU crc32 instructions

2015-08-28 18:20:22 10702 [Note] InnoDB: Initializing buffer pool, size = 128.0m

2015-08-28 18:20:22 10702 [Note] InnoDB: Completed initialization of buffer pool

2015-08-28 18:20:22 10702 [Note] InnoDB: The first specified data file. / ibdata1 did not exist: a new database to be created!

2015-08-28 18:20:22 10702 [Note] InnoDB: Setting file. / ibdata1 size to 12 MB

2015-08-28 18:20:22 10702 [Note] InnoDB: Database physically writes the file full: wait...

2015-08-28 18:20:22 10702 [Note] InnoDB: Setting logfile. / ib_logfile101 size to 48 MB

2015-08-28 18:20:23 10702 [Note] InnoDB: Setting logfile. / ib_logfile1 size to 48 MB

2015-08-28 18:20:24 10702 [Note] InnoDB: Renaming logfile. / ib_logfile101 to. / ib_logfile0

2015-08-28 18:20:24 10702 [Warning] InnoDB: New log files created, LSN=45781

2015-08-28 18:20:24 10702 [Note] InnoDB: Doublewrite buffer not found: creating new

2015-08-28 18:20:24 10702 [Note] InnoDB: Doublewrite buffer created

2015-08-28 18:20:24 10702 [Note] InnoDB: 128rollback segment (s) are active.

2015-08-28 18:20:24 10702 [Warning] InnoDB: Creating foreign key constraint system tables.

2015-08-28 18:20:24 10702 [Note] InnoDB: Foreign key constraint system tables created

2015-08-28 18:20:24 10702 [Note] InnoDB: Creating tablespace and datafile system tables.

2015-08-28 18:20:24 10702 [Note] InnoDB: Tablespace and datafile system tables created.

2015-08-28 18:20:24 10702 [Note] InnoDB: Waiting for purge to start

2015-08-28 18:20:24 10702 [Note] InnoDB: 5.6.25 started; log sequence number 0

2015-08-28 18:20:24 10702 [Note] RSA private key file not found: / usr/local/mysql/data//private_key.pem. Some authentication plugins will not work.

2015-08-28 18:20:24 10702 [Note] RSA public key file not found: / usr/local/mysql/data//public_key.pem. Some authentication plugins will not work.

2015-08-28 18:20:25 10702 [Note] Binlog end

2015-08-28 18:20:25 10702 [Note] InnoDB: FTS optimize thread exiting.

2015-08-28 18:20:25 10702 [Note] InnoDB: Starting shutdown...

2015-08-28 18:20:26 10702 [Note] InnoDB: Shutdown completed; log sequence number 1625977

OK

Filling help tables...2015-08-28 18:20:26 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details).

2015-08-28 18:20:26 0 [Note]. / bin/mysqld (mysqld 5.6.25-enterprise-commercial-advanced) starting as process 10725.

2015-08-28 18:20:26 10725 [Note] InnoDB: Using atomics to ref count buffer pool pages

2015-08-28 18:20:26 10725 [Note] InnoDB: The InnoDB memory heap is disabled

2015-08-28 18:20:26 10725 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins

2015-08-28 18:20:26 10725 [Note] InnoDB: Memory barrier is not used

2015-08-28 18:20:26 10725 [Note] InnoDB: Compressed tables use zlib 1.2.3

2015-08-28 18:20:26 10725 [Note] InnoDB: Using Linux native AIO

2015-08-28 18:20:26 10725 [Note] InnoDB: Using CPU crc32 instructions

2015-08-28 18:20:26 10725 [Note] InnoDB: Initializing buffer pool, size = 128.0m

2015-08-28 18:20:26 10725 [Note] InnoDB: Completed initialization of buffer pool

2015-08-28 18:20:26 10725 [Note] InnoDB: Highest supported file format is Barracuda.

2015-08-28 18:20:26 10725 [Note] InnoDB: 128rollback segment (s) are active.

2015-08-28 18:20:26 10725 [Note] InnoDB: Waiting for purge to start

2015-08-28 18:20:26 10725 [Note] InnoDB: 5.6.25 started; log sequence number 1625977

2015-08-28 18:20:26 10725 [Note] RSA private key file not found: / usr/local/mysql/data//private_key.pem. Some authentication plugins will not work.

2015-08-28 18:20:26 10725 [Note] RSA public key file not found: / usr/local/mysql/data//public_key.pem. Some authentication plugins will not work.

2015-08-28 18:20:27 10725 [Note] Binlog end

2015-08-28 18:20:27 10725 [Note] InnoDB: FTS optimize thread exiting.

2015-08-28 18:20:27 10725 [Note] InnoDB: Starting shutdown...

2015-08-28 18:20:28 10725 [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:

. / bin/mysqladmin-u root password' new-password'

. / bin/mysqladmin-u root-h mysql01 password' new-password'

Alternatively you can run:

. / 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. ;. / 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. / 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@mysql01 mysql] # cp / usr/share/mysql/my-default.cnf / etc/my.cnf

8. Set user access and startup, login test

[root@mysql01 mysql] # chown-R root.

[root@mysql01 mysql] # chown-R mysql data

[root@mysql01 mysql] # bin/mysqld_safe-- user=mysql &

[1] 10860

[root@mysql01 mysql] # 150828 18:25:13 mysqld_safe Logging to'/ usr/local/mysql/data/mysql01.err'.

150828 18:25:14 mysqld_safe Starting mysqld daemon with databases from / usr/local/mysql/data

[root@mysql01 mysql] # ps-ef | grep mysql

Root 10860 3947 0 18:25 pts/0 00:00:00 / bin/sh bin/mysqld_safe-user=mysql

Mysql 10962 10860 1 18:25 pts/0 00:00:00 / usr/local/mysql/bin/mysqld-basedir=/usr/local/mysql-datadir=/usr/local/mysql/data-plugin-dir=/usr/local/mysql/lib/plugin-user=mysql-log-error=/usr/local/mysql/data/mysql01.err-pid-file=/usr/local/mysql/data/mysql01.pid

Root 11007 3947 0 18:26 pts/0 00:00:00 grep mysql

[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 13

Server version: 5.6.25-enterprise-commercial-advanced

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

ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

Mysql > set password for root@'localhost'=password ("666666")

Query OK, 0 rows affected (0.10 sec)

Mysql > show databases

+-+

| | Database |

+-+

| | information_schema |

| | mysql |

| | performance_schema |

| | test |

+-+

4 rows in set (0.14 sec)

Mysql > exit

Bye

Note:

Before version 5.6 of MySQL, the database installed by default can be connected directly and requires a password. However, after entering version 5.6, the database administrator account (i.e. root) is built.

There will be password protection by default, and the initial password setting is also very strict, which also shows that after entering version 5.6, the security setting has been improved to a certain extent.

[root@mysql01] # mysql-uroot-p

Enter password:666666

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

Your MySQL connection id is 13

Server version: 5.6.25-enterprise-commercial-advanced

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 |

| | mysql |

| | performance_schema |

| | test |

+-+

4 rows in set (0.14 sec)

9. Copy the mysql.server under the support-files directory to / etc/init.d to test the start and stop service.

[root@mysql01 mysql] # cp support-files/mysql.server / etc/init.d

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

-rwxr-xr-x. 1 root root 10880 Aug 28 19:07 / etc/init.d/mysql.server

[root@mysql01 mysql] # / etc/init.d/mysql.server stop

Shutting down MySQL..150828 19:08:44 mysqld_safe mysqld from pid file / usr/local/mysql/data/mysql01.pid ended

[OK]

[1] + Done bin/mysqld_safe-- user=mysql

[root@mysql01 mysql] # / etc/init.d/mysql.server start

Starting MySQL.. [OK]

[root@mysql01 mysql] # / etc/init.d/mysql.server status

MySQL running (12316) [OK]

10. Set the PATH in the environment variable so that you can use mysql-related commands directly

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

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

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

Or:

[root@mysql01] #. .bash _ profile

[root@mysql01] # mysql-uroot-p

Enter password:666666

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

Your MySQL connection id is 13

Server version: 5.6.25-enterprise-commercial-advanced

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 |

| | mysql |

| | performance_schema |

| | test |

+-+

4 rows in set (0.14 sec)

On "MySQL 5.5.25 how to use tar installation and upgrade to 5.6.26 for RedHat Enterprise Linux 6.4" this article is shared here, 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 out 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