The CentOS system is installed through the tar.gz package Mysql5.7

Source: Internet
Author: User

1. Before installing MySQL, you need to ensure that the system has Libaio dependencies, using the following command:

2. Go to the CentOS terminal interface and download the mysql5.7 64-bit installation file using the wget command:

Wget-c https://cdn.mysql.com//downloads/mysql-5.7/ Mysql-5.7.18-linux-glibc2.5-x86_64.tar.gz

Download Complete:

3. Extract the MySQL installation package to the specified directory with the following command:

TAR-ZXVF mysql-5.7. -LINUX-GLIBC2. 5

4. Enter the/usr/local directory:

Cd/usr/local

5. Create a soft link for the MySQL installation directory:

Ln-s mysql-5.7. -LINUX-GLIBC2. 5-x86_64 MySQL

6. Add MySQL user group and MySQL user to CentOS (the-s/bin/false parameter specifies that the MySQL user has only ownership and no login privileges):

-r-g mysql-s/bin/false MySQL

7. Go to the directory where the MySQL software is installed and command the following:

Cd/usr/local/mysql

8. Modify the current directory owner for the new MySQL user, the command is as follows:

Chown-r Mysql:mysql./

9. Install MySQL with the following command:

./bin/mysqld--user=mysql--basedir=/usr/local/mysql--datadir=/usr/local/mysql/data--initialize

When the installation is complete, the following information appears, recording the randomly generated login password:

10. Start the MySQL service with the following command:

./support-files/mysql.server Start

11. Place the MySQL process into the system process with the following command:

CP Support-files/mysql.server/etc/init.d/mysqld

12. Restart the MySQL service with the following command:

Service mysqld Restart

13. Log in to the MySQL database using a random password, with the following command:

Mysql-u root-p

Wait for the system prompt, enter a random password, you can log in

14. Enter the MySQL operation line and set a new password for the root user (small set to Rootroot):

' Root '@'localhost'rootroot';

15. Set the Allow remote connection to the database with the following command:

set user. host='%'where user. user='root';

16. Refresh the permissions with the following command:

Flush privileges;

The CentOS system is installed through the tar.gz package Mysql5.7

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.