Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install mysql5.7 with linux source code

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Linux source code how to install mysql5.7? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.

1. Download the mysql source installation package

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

two。 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.*"

4. The picture above indicates that the installation is successful.

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

5. Install Mysql

Yum install mysql-community-server

6. Start Mysql

Systemctl start mysqld

7. Boot up

Systemctl enable mysqldsystemctl daemon-reload

8. Modify root local login password

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

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

Command:

Mysql-uroot-p

Problem: centos7.0 uses mysql-u root-p to connect to the database after installing mysql5.7.11. Operation hint: You must reset your password using ALTER USER statement before executing this statement.

Follow the prompt ALTER USER to change the password is not valid, and later found that the following command can be executed:

SET PASSWORD = PASSWORD ('123456'); set password for 'root'@'localhost'=password (' your new password')

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

Grant all on *. * to 'root'@'127.0.0.1' identified by' 123123'WITH GRANT OPTION;flush privileges; / / refresh the permission table

Note:

Restart the mysql service after modifying the configuration to take effect:

Systemctl restart mysqld

Default profile 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

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report