Centos provided repository-based Yum MySQL installation MySQL5.6

1. Download yum source

# wget http://dev.mysql.com/get/mysql57-community-release-el6-8.noarch.rpm

After the download is complete, as shown below:

2. Install the yum package

2.1 view files you want to install this package

# rpm -qpl mysql80-community-release-el8-1.noarch.rpm

The results shown below:

2.2 Installation

# rpm -ivh mysql80-community-release-el8-1.noarch.rpm 

After the installation is complete, it will automatically configure yum source.

3. Choose a MySQL distribution package version

View version 3.1 available
# yum repolist all | grep mysql

The results are as follows:

Modify the available version 3.2

# vi /etc/yum.repos.d/mysql-community.repo

Enabled version of the corresponding modified value, can be represented by 1, 0 indicates not available.

When all versions of the value is 1, the default start the latest version, so it is best enabled the value of other versions are not set to 0.
View revised results:

# yum repolist enabled | grep mysql

Modified result as shown below:

4. Install MySQL

# yum -y install mysql-community-server

After successful installation, as shown below:

5. Switch MySQL service

5.1 Start

# service mysqld start

5.2 View Status

# service mysqld status

The results shown below:

6. Safety Control (version 5.6 only)

Using the command mysql_secure_installation can modify the user password, account management and other functions.

  • After the first successful installation, enter the command directly enter, no password:
  • Set a password for the root account
  • Delete anonymous accounts
  • All options are entered y back on the line. There is a remote connection to prohibit the root account, enter n and has no effect.

Guess you like

Origin www.cnblogs.com/feilstar/p/12651357.html