Centos 7 Installation MySQL 5.7

Source: Internet
Author: User
Tags mysql command line

The installation steps are:

1. Since MySQL rpm has been removed from CentOS 7, it is necessary to download the RPM on its official website, and after downloading, use the following command to install the MySQL rpm configuration.

RPM-IVH *****[Note: * For RPM file name]

2. After installing RPM, use the following command to install.

Yum Install Mysql-community-server

3. After the installation is complete, use the following command to restart the MySQL service.

Systemctl Restart Mysqld.service

4. Then enter the command at the command terminal to enter the MySQL command line interface.

Mysql-u Root

At this time, however, the error is generally reported: Access denied for user ' root ' @ ' localhost ' (using Password:no), as shown in:

Prompt, you must enter a password in order to enter.

During the installation, MySQL generates a random password for the current installation account and is stored in the log, so you can find the password generated at the time of installation in the log using the following command.

sudo grep ' Temporary password ' /var/log/mysqld.log

After the password is queried, use the following command to enter the password entry and enter the MySQL command line environment after entering the correct password.

Mysql-u root-p

5. After entering the environment, the following configuration should be completed:

Change Password:

Use commands First

' %password% ';

To view the password policy for MySQL:

Then, use the following command to modify the password.

 for [Email Protected]=password ('##############');

Allow root remote login:

First switch to the MySQL database and use the command below to allow the root account to log in remotely.

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

To modify the MySQL character set:

Using tools such as VI or GEDIT, open the /etc/my.cnf file and add a line of code under the [Mysqld] line:

Character_set_server=utf8

After saving, restart the MySQL service:

Systemctl Restart Mysqld.servcie

If CentOS 7 is a database server, you can also use the following command to have MySQL boot up with the system.

Systemctl Enable Mysqld.service

After restarting, use the following command to view the character set usage for MySQL.

' %character% ';

At this point, in the Centso 7 environment, the MySQL installation configuration is complete. Clients can connect using tools such as Navicat, which can be successfully connected.

Centos 7 Installation MySQL 5.7

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.