Installing MySQL on the CentOS7

Source: Internet
Author: User

1. Installing CentOS

Refer to the installation and configuration of CentOS

2. Install MySQL 2.1 Downloads mysql.rpm

Use the following command to download the mysql.rpm file to a local

wget https://dev.mysql.com/get/downloads/mysql-8.0/ mysql-community-server-8.0.11-1.el7.x86_64.rpm

Use the following command to add the RPM to the address source and install

Yum localinstall mysql.rpm

Start MySQL with the following command

Systemctl Start mysqld

Use the following command to check the systemctl status mysqld

Use the following command to set up the MySQL service boot

Systemctl Enable Mysqld

2.2mysql Configuration

2.2.1 Password reset

After MySQL installation is successful, the root account is set to the initial password, you can find the password by the following command.

grep ' Password '/var/log/mysqld.log

log in to MySQL using root, such as the following command

Mysql-u root-p

MySQL will prompt for a password, enter the password found above, after successful login, use the following command to modify the password.

ALTER USER ' root ' @ ' localhost ' identified by ' * '

Note: Passwords need to meet MySQL security policy requirements.

2.2.2 Authorized Telnet

The default root account is not remote login, need authorization, first login mysql

Use the UPDATE statement to change the host field of the user table under the MySQL library , and then refresh the permissions.

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

2.2.3 Authorization

Use the following command to authorize

Grant all privileges the on database to account;

Grant Partial permissions:

Select, insert on database to account;

2.2.4 MySQL configuration file

Cat/etc/my.cnf

Here you can modify the default character set and save the following configuration in MY.CNF.

Character_set_server=utf8

Installing MySQL on the CentOS7

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.