MySQL installation detailed process, tar mode

Source: Internet
Author: User

1. Create MySQL user and MySQL user group

Groupadd MySQL

Useradd-r-G MySQL MySQL


2. Download the mysql-5.7.17 package to my shared network disk

Link: http://pan.baidu.com/s/1gfAA87p Password: Iuti


3, copy the downloaded installation package to the Linux system, can be via SFTP or shared network disk

TAR-ZXVF mysql-5.7.17-linux-glibc2.5-x86_64

CP Mysql-5.7.17-linux-glibc2.5-x86_64/opt/mysql


4. Create the Data directory

Mkdir/opt/mysql/data


5. Install the database

Switch to the/opt/mysql directory

Cd/opt/mysql

Modify the owner of the current directory to be a MySQL user

Chown-r Mysql:mysql./

Installing the Database

Bin/mysqld--initialize--user=mysql--basedir=/opt/mysql--datadir=/opt/mysql/data

If you are prompted for missing libaio.so installation Libaio, then perform the above installation command

Yum-y Install libai*

The installation succeeds with the following prompt, where NZ*TJVCD?6NC is the password

2017-05-09t03:38:34.197041z 1 [Note] A temporary password is generated for [email protected]: NZ*TJVCD?6NC

6. Execute the following command to create the RSA private key

Bin/mysql_ssl_rsa_setup--datadir=/usr/local/mysql/data

7. Modify the current user owner as Root

Chown-r Root:root./

Modify the current data directory owner for MySQL

Chown-r Mysql:mysql./data

8, modify the MY.CNF and boot start

CD Support-filessudo

CP My-default.cnf/etc/my.cnfsudo

CP Mysql.server/etc/init.d/mysqlsudo

Vim/etc/init.d/mysql

# #修改basedir = installation directory

# #修改datadir = installation directory

9, modify the MY.CNF

Vim/etc/my.cnf

[Mysqld]

Character-set-server=utf8

Datadir=/opt/mysql/data

Basedir=/opt/mysql

Socket=/var/lib/mysql/mysql.sock

[Client]

Socket=/var/lib/mysql/mysql.sock


Create a Directory

Mkdir-p/var/lib/mysql/

Chown-r Mysql:mysql/var/lib/mysql

Start MySQL

Service MySQL Start


MySQL installation detailed process, tar mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.