Home  >  Article  >  Database  >  Linux source code installation mysql5.7

Linux source code installation mysql5.7

马冠亚
马冠亚Original
2020-07-08 14:51:542124browse

1. Download the mysql source installation package

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

2. Install the mysql source

yum localinstall mysql57-community-release-el7-8.noarch.rpm

3. Check whether the mysql source is installed successfully

yum repolist enabled | grep "mysql.*-community.*"

Linux source code installation mysql5.7

4. When you see the picture above, the installation is successful.

You can modify the vim /etc/yum.repos.d/mysql-community.repo source and change the default installation. mysql version. For example, to install version 5.6, change the enabled=1 of the 5.7 source to enabled=0. Then change the enabled=0 of the 5.6 source to enabled=1. The effect after the modification is as follows:

Linux source code installation mysql5.7

5. Install Mysql

yum install mysql-community-server

6. Start Mysql

systemctl start mysqld

7. Start up

systemctl enable mysqldsystemctl daemon-reload

8 .Modify the root local login password

After the mysql installation is completed, a default password is generated for root in the /var/log/mysqld.log file. Find the root default password in the following way, and then log in to mysql to modify it:

grep 'temporary password' /var/log/mysqld.log

Linux source code installation mysql5.7

Command:

mysql -uroot -p

Question: centos7.0 is installed After mysql5.7.11, use mysql -u root -p to connect to the database. Operation tip: You must reset your password using ALTER USER statement before executing this statement.

Following the prompts ALTER USER to change the password is invalid. Later I found that executing the following command can be done:

SET PASSWORD = PASSWORD(‘123456’);
set password for 'root'@'localhost'=password('你的新密码');

The default password check policy requires that passwords must contain: uppercase and lowercase letters, numbers, and special symbols, and must be no less than 8 characters in length. Otherwise, the error ERROR 1819 (HY000): Your password does not satisfy the current policy requirements will be prompted, as shown in the following figure:

Linux source code installation mysql5.7##

grant all on *.* to 'root'@'127.0.0.1' identified by '123123'WITH GRANT OPTION;
flush privileges; //刷新权限表

Notes:

After modifying the configuration, restart the mysql service to take effect:

systemctl restart mysqld

Default configuration file path:

Configuration file:/etc/my.cnf

Log file:/var/log //var/log/mysqld.log

Service startup script:/usr/lib/systemd/system/mysqld.service

socket file:/var/run/mysqld/mysqld.pid

The above is the detailed content of Linux source code installation mysql5.7. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Related articles

See more