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 mysql5.6 with binary installation package in centos7 environment

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

Share

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

This article mainly introduces the centos7 environment binary installation package how to install mysql5.6, the article is very detailed, has a certain reference value, interested friends must read it!

This paper gives an example of how to install mysql5.6 in binary installation package under centos7 environment. Share with you for your reference, the details are as follows:

Centos7 binary installation package install mysql5.6

Download the mysql5.6 binary installation package

Http://mirrors.sohu.com/mysql/MySQL-5.6/

Such as: mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz

Second, install mysql5.6 (installed in / data/mysql56)

(1) create a mysql user account

> useradd-s / sbin/nologin-M mysql

(2) decompress the package

> tar xf mysql-5.6.34-linux-glibc2.5-x86_64.tar.gz

(3), rename

> mv mysql-5.6.34-linux-glibc2.5-x86_64 mysql56

(4) copy the configuration file

> cp / data/mysql56/support-files/my-default.cnf / etc/my.cnf

Modify the configuration file

[client] port = 3306socket = / data/mysql56/mysql.sockdefault-character-set = UTF8 [mysqld] skip-name-resolveuser = mysqlbasedir = / data/mysql56datadir = / data/mysql56/dataport = 3306server_id = 10socket = / data/mysql56/mysql.sockpid-file = / data/mysql56/mysql.pidlog-error = / data/mysql56/data/mysql.errlog-bin = / data/mysql56/data/mysql-bincharacter-set-server = utf8

(* binary installation, default configuration file is / etc/my.cnf)

(5) initialize the database

> chown-R mysql.mysql / data/mysq56 > / data/mysql56/scripts/mysql_install_db\-defaults-file=/etc/my.cnf\-user=mysql\-basedir=/data/mysql56\-datadir=/data/mysql56/data

If the following message appears

FATAL ERROR: please install the following Perl modules before executing

Data::Dumper

> yum-y install autoconf

The Data:Dumper module is installed when this package is installed

Configure and start mysql

> cp / data/mysql56/support-files/mysql.server / etc/init.d/mysqld > chmod 755 / etc/init.d/mysqld

(* Note that the default path for mysql binary installation is / usr/local/mysql, and / usr/local/mysql needs to be replaced in the startup script)

> sed-I's accountUniqqqql56 data/mysql56/bin/mysqld_safe / etc/init.d/mysqld

Start mysql

> service mysqld start

Add self-startup

> chkconfig-- add mysqld > chkconfig mysqld on > chkconfig-- list mysqld

Fifth, configure environment variables

> echo 'export PATH=/data/mysql56/bin:$PATH' > > / etc/profile > source / etc/profile

Change the mysql password (the default root password for mysql5.6 installation is empty)

> mysqladmin-u root password '123456'

7. Clean up useless mysql users and libraries

Log in to mysql

> mysql-uroot-p

Query users

> select user,host from mysql.user

As shown below

+-+

| | user | host |

+-+

| | root | 127.0.0.1 | |

| | root |:: 1 |

| | localhost |

| | root | localhost |

| | localhost.localdomain |

| | root | localhost.localdomain |

+-+

> drop user "root" @ ":: 1"; > drop user "" @ "localhost"; > drop user "" @ "localhost.localdomain"; > drop user "root" @ "localhost.localdomain"

Delete useless libraries

> drop database test; above are all the contents of the article "how to install mysql5.6 in a binary installation package in centos7". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to 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