Redhat7.1 detailed steps for installing mysql 5.7.10 (graphic description ),

Source: Internet
Author: User

Redhat7.1 detailed steps for installing mysql 5.7.10 (graphic description ),

To install MySQL under redhat, follow these steps:

Mysql directory installation path:/usr/local/mysql

Database storage location:/data/mysql

Log storage location:/data/log/mysql

Download installation package http://downloads.mysql.com/archives/community/

1. The mysqlinstallation package is obtained. After mysql-5.7.10-linux-glibc2.5-x86_64.tar is decompressed, the directory is as follows.

2. decompress the mysql-5.7.10-linux-glibc2.5-x86_64.tar.gz installation package. The command is as follows.

# Tar -zxvfmysql-5.7.10-linux-glibc2.5-x86_64.tar.gz

3. Move the unzipped installation package to the/usr/local/directory and change the name. The command is as follows.

# Music mysql-5.7.10-linux-glibc2.5-x86_64/usr/local/
# Cd/usr/local/
# Music mysql-5.7.10-linux-glibc2.5-x86_64/mysql

4. Create the data Warehouse directory/data/mysql/command as follows.

# Mkdir/data
# Cd data
# Mkdir mysql

5. Create a mysql user, group, and directory.

Create a mysql group with the following command.

# Useradd-r-s/sbin/nologin-g mysql-d/usr/local/mysql --- create an msyql user to prohibit shell Login

6. Change the directory owner

# Cd/usr/local/mysql
# Pwd
# Chown-R mysql.
# Chgrp-R mysql.

Switch to the Data Warehouse directory to change permissions

# Cd/data/mysql
# Chown-R mysql/data/mysql

7. Configure Parameters

# Cd/usr/local/mysql
# Bin/mysqld -- initialize -- user = mysql -- basedir =/usr/local/mysql -- datadir =/data/mysql

Note the generated temporary password, as shown in blue: h (g + qq) pk6fw

# Bin/mysql_ssl_rsa_setup -- datadir =/data/mysql

The execution result is as follows:

8. Modify system configuration parameters (note the current directory). The command is as follows.

# Cd support-files
# Cp my-default.cnf/etc/my. cnf
# Cp mysql. server/etc/init. d/mysql

The execution result is as follows:

Modify/etc/init. d/mysql

# Vi/etc/init. d/mysql

The modification is shown in the red box.

Modify/etc/my. cnf
# Vi/etc/my. cnf

The added content is shown in the red box.

9. Create the log file directory "/data/log/mysql/mysql_error.log". The command is as follows.

# Cd/data
# Mkdir log
# Cdlog/
# Mkdir mysql
# Cdmysql/
# Touch mysql_error.log

10. Create the mysqld_safe.pid file and run the following command.

# Cd/usr/local/mysql
# Mkdirdata
# Cddata/
# Touch mysqld_safe.pid

11. Synchronize mysql with the following command.

# Ln-s/usr/local/mysql/bin/mysql/usr/bin/
# Ln-s/usr/local/mysql/bin/mysqladmin/usr/bin/

12. Run the following command to start the mysql service.

# Service mysql start

13. Enter the command to connect to mysql

# Mysql-u root-p
# Enter the password that is saved in step 1.

Go to mysql to change the password. The command is as follows.

# Setpassword = password ('admin ')

14. If so, the password is successfully modified. Enter exit. The installation of mysql is complete.

The above section describes how to install mysql 5.7.10 in redhat7.1 (graphic description). I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!

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.