Linux source code installation mysql5.7

马冠亚
Release: 2020-07-08 17:08:14
Original
2053 people have browsed it

1. Download the mysql source installation package

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

2. Install the mysql source

yum localinstall mysql57-community-release-el7-8.noarch.rpm
Copy after login

3. Check whether the mysql source is installed successfully

yum repolist enabled | grep "mysql.*-community.*"
Copy after login

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
Copy after login

6. Start Mysql

systemctl start mysqld
Copy after login

7. Start up

systemctl enable mysqldsystemctl daemon-reload
Copy after login

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
Copy after login

Linux source code installation mysql5.7

Command:

mysql -uroot -p
Copy after login

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('你的新密码');
Copy after login

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; //刷新权限表
Copy after login

Notes:

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

systemctl restart mysqld
Copy after login
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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!