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 MySQL 5.6 in yum mode under CentOS 6.7.How to install MySQL 5.6

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article is to share with you about how to install yum under CentOS 6.7. the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

1. Download the yum source

My test environment is as follows:

[root@test ~] # cat / etc/redhat-release

CentOS release 6.7 (Final)

So I downloaded the centos6 system yum source:

Wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm

3. Modify yum source configuration

Vim / etc/yum.repos.d/mysql-community.repo

Install mysql5.6 operation

1), change other versions of enabled=1 to enabled=0

2) change version 5.6 enabled=0 to enabled=1

# Enable to use MySQL 5.6

[mysql56-community]

Name=MySQL 5.6 Community Server

Baseurl= http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/

Enabled=1

Gpgcheck=1

Gpgkey= file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

4. Install the package and install it now.

[root@test ~] # yum install mysql-community-server

Loaded plug-ins: fastestmirror, security

Set up the installation process

Loading mirror speeds from cached hostfile

* base: mirrors.aliyun.com

* epel: mirrors.yun-idc.com

* extras: mirrors.aliyun.com

* updates: mirrors.aliyun.com

Resolve dependencies

-- > perform transaction check

-> Package mysql-community-server.x86_64 0VOR 5.6.47-2.el6 will be installation

-- > handling dependencies mysql-community-common (x86-64) = 5.6.47-2.el6, which is required by the package mysql-community-server-5.6.47-2.el6.x86_64

-- > handling dependencies mysql-community-client (x86-64) > = 5.6.10, which is required by the package mysql-community-server-5.6.47-2.el6.x86_64

-- > perform transaction check

-> Package mysql-community-client.x86_64 0VOR 5.6.47-2.el6 will be installation

-- > handling dependencies mysql-community-libs (x86-64) > = 5.6.10, which is required by the package mysql-community-client-5.6.47-2.el6.x86_64

-> Package mysql-community-common.x86_64 0VOR 5.6.47-2.el6 will be installation

-- > perform transaction check

-> Package mysql-community-libs.x86_64 0VOR 5.6.47-2.el6 will be installation

-- > complete dependency calculation

Dependency resolution

=

Package architecture version repository size

=

Installing:

Mysql-community-server x8631 64 5.6.47-2.el6 mysql56-community 77m

Install for dependency:

Mysql-community-client x8631 64 5.6.47-2.el6 mysql56-community 34m

Mysql-community-common x8631 64 5.6.47-2.el6 mysql56-community 341k

Mysql-community-libs x8631 64 5.6.47-2.el6 mysql56-community 3.6m

Transaction summary

=

Install 4 Package (s)

Total file size: 114m

Total downloads: 77 M

Installed size: 478 M

Are you sure? [y/N]: y

Download the software package:

Mysql-community-server-5.6.47-2.el6.x86_64.rpm | 77 MB 43:30

Warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Importing GPG key 0x5072E1F5:

Userid: MySQL Release Engineering

Package: mysql57-community-release-el6-7.noarch (installed)

From: / etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Are you sure? [y/N]: y

Run rpm_check_debug

Perform transaction testing

Transaction test was successful

Execute a transaction

Warning: RPMDB altered outside of yum.

Installing: mysql-community-common-5.6.47-2.el6.x86_64 1 Compact 4

Installing: mysql-community-libs-5.6.47-2.el6.x86_64 2 Compact 4

Installing: mysql-community-client-5.6.47-2.el6.x86_64 3 Compact 4

Installing: mysql-community-server-5.6.47-2.el6.x86_64 4 Compact 4

Verifying: mysql-community-libs-5.6.47-2.el6.x86_64 1 Compact 4

Verifying: mysql-community-common-5.6.47-2.el6.x86_64 2 Compact 4

Verifying: mysql-community-client-5.6.47-2.el6.x86_64 3 Compact 4

Verifying: mysql-community-server-5.6.47-2.el6.x86_64 4 Compact 4

Installed:

Mysql-community-server.x86_64 0RU 5.6.47-2.el6

Installed as a dependency:

Mysql-community-client.x86_64 0VOR 5.6.47-2.el6 mysql-community-common.x86_64 0RU 5.6.47-2.el6 mysql-community-libs.x86_64 0RU 5.6.47-2.el6

Over!

5. Start the mysql service

[root@test ~] # service mysqld start

Initialize the MySQL database: 2020-03-30 23:47:20 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use-explicit_defaults_for_timestamp server option (see documentation for more details).

2020-03-30 23:47:20 0 [Note] Ignoring-- secure-file-priv value as server is running with-- bootstrap.

...

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

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

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

/ usr/bin/mysqladmin-u root-h test password' new-password'

Alternatively you can run:

/ usr/bin/mysql_secure_installation

Which will also give you the option of removing the test

...

Note: new default config file not created.

Please make sure your config file is current

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

[OK]

Starting mysqld: [OK]

6. View status and version

[root@test ~] # chkconfig-- list | grep mysqld

Mysqld 0: off 1: close 2: close 3: enable 4: enable 5: enable 6: close

[root@test] # mysqladmin-- version

Mysqladmin Ver 8.42 Distrib 5.6.47, for Linux on x86_64

[root@test ~] # mysqladmin-u root password "mysql123"

Warning: Using a password on the command line interface can be insecure.

[root@test] # mysql-u root-p

Enter password:

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

Your MySQL connection id is 3

Server version: 5.6.47 MySQL Community Server (GPL)

Copyright (c) 2000, 2020, 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.

7. Set the root user password

[root@test ~] # mysqladmin-u root password "mysql123"

Warning: Using a password on the command line interface can be insecure.

8. View and create the database

[root@test mysql] # mysql-u root-p

Enter password:

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

Your MySQL connection id is 5

Server version: 5.6.47 MySQL Community Server (GPL)

Mysql > show databases

+-+

| | Database |

+-+

| | information_schema |

| | mysql |

| | performance_schema |

+-+

3 rows in set (0.00 sec)

Mysql > CREATE DATABASE testtb DEFAULT CHARSET utf8 COLLATE utf8_general_ci

Query OK, 1 row affected (0.00 sec)

Mysql > show databases

+-+

| | Database |

+-+

| | information_schema |

| | mysql |

| | performance_schema |

| | testtb |

+-+

4 rows in set (0.00 sec)

9. View the database directory

[root@test ~] # ls / var/lib/mysql-al

The total dosage is 110616

Drwxr-xr-x 5 mysql mysql 4096 March 31 00:19.

Drwxr-xr-x. 30 root root 4096 March 30 20:57..

-rw-rw---- 1 mysql mysql 56 March 30 23:47 auto.cnf

-rw-rw---- 1 mysql mysql 12582912 March 30 23:47 ibdata1

-rw-rw---- 1 mysql mysql 50331648 March 30 23:47 ib_logfile0

-rw-rw---- 1 mysql mysql 50331648 March 30 23:47 ib_logfile1

Drwx- 2 mysql mysql 4096 March 30 23:47 mysql

Srwxrwxrwx 1 mysql mysql 0 March 30 23:47 mysql.sock

Drwx- 2 mysql mysql 4096 March 30 23:47 performance_schema

Drwx- 2 mysql mysql 4096 March 31 00:19 testtb

The above is how to install MySQL 5.6 in yum mode under CentOS 6.7.The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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