Install the mysql5.7.9tar package in centos6.6

Source: Internet
Author: User

Install the mysql5.7.9tar package in centos6.6

I. Tools used:

1. vmware10 Virtual Machine

2. centos 6.6

3. secureCRT

Ii. system settings:

1. Installation File Download Directory:/home/tools/

2. mysql installation directory:/usr/local/mysql

Iii. File Download:

Http://downloads.mysql.com/archives/get/file/mysql-5.7.9-linux-glibc2.5-x86_64.tar

1. Download the tar package in windows and import it to the/home/tools/directory using the rz command in centos.

2. Use the wget command in centos to download the SDK.

Note: rz and wget can be used without installation.

Iv. installation:

1. Decompress package: tar-zxvf mysql-5.7.9-linux-glibc2.5-x86_64.tar.gz

2. Rename and move: Music mysql-5.7.9-linux-glibc2.5-x86_64/usr/local/mysql

3. Create a mysql user and group:

[Root @ study local] # id mysql

Id: mysql: No such user

# Useradd-s/sbin/nologin-M mysql

Note:-s: Specifies the shell used after the user logs on. The default value is/bin/bash.

-M: do not automatically create a user's logon directory.

4. Modify the permission to create data:

# Mkdir/usr/local/mysql/data

# Cd/usr/local

# Chown-R mysql: mysql/usr/local/mysql-R: recursion, changing directory and File Permissions

5. installation:

[Root @ study mysql] #./bin/mysqld -- initialize -- user = mysql -- basedir =/usr/local/mysql -- datadir =/usr/local/mysql/data

Record the temporary password and use:/lxW + 2 for the First Login <(9jk:

Configure the ssl configuration file:

[Root @ study mysql] # bin/mysql_ssl_rsa_setup -- datadir =/usr/local/mysql/data

6. mysql Configuration:

[Root @ study mysql] # cd support-files/

# Cp my-default.cnf/etc/my. cnf

# Cp mysql. server/etc/init. d/mysql

7. Set environment variables:

[Root @ study support-files] # vim/etc/profile

Add the last line of the file: export PATH =/usr/local/mysql/bin: $ PATH

Wq save and exit

[Root @ study support-files] # The source/etc/profile environment variable takes effect

8. Set boot start:

# Chkconfig mysql on

# Chkconfig | grep mysql

9. login test:

Check whether the mysql process exists: # ps-ef | grep mysql

# Service mysql start

# Mysql-uroot-p press enter and paste the previously recorded temporary password. login successful

Change the temporary password for the first time

: Change Password

Mysql> set password = password ('a123456 ');

Mysql authorization:

Mysql> grant all privileges on *. * to root @ '%' identified by 'a123456 ';

Update permission:

Mysql> flush privileges;

It can be used normally.

Related Article

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.