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

Install mysql in centos7

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

Share

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

1. New groups, new users

[root@ticent admin] # groupadd mysql

[root@ticent admin] # useradd-m-g mysql mysql

[root@ticent admin] #

two。 Check whether it has been installed. If so, you need to remove it first.

[root@ticent admin] # rpm-qa | grep mysql

[root@ticent admin] #

3. Modify mysql user password

[root@ticent admin] # passwd mysql

4. download

[mysql@ticent ~] $wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-community-client-5.7.18-1.el7.x86_64.rpm

[mysql@ticent ~] $wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-community-libs-5.7.18-1.el7.x86_64.rpm

[mysql@ticent ~] $wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-community-common-5.7.18-1.el7.x86_64.rpm

[mysql@ticent ~] $wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-community-server-5.7.18-1.el7.x86_64.rpm

[mysql@ticent ~] $ll

The total dosage is 157960

-rw-rw-r--. 1 mysql mysql 25079412 March 20 17:40 mysql-community-client-5.7.18-1.el7.x86_64.rpm

-rw-rw-r--. 1 mysql mysql 277784 March 20 17:40 mysql-community-common-5.7.18-1.el7.x86_64.rpm

-rw-rw-r--. 1 mysql mysql 2237888 March 20 17:40 mysql-community-libs-5.7.18-1.el7.x86_64.rpm

-rw-rw-r--. 1 mysql mysql 128210634 June 6 01:02 mysql-community-server-5.7.18-1.el7.x86_64.rpm

5. You can use either root user installation or mysql user installation. If you use mysql, you need to modify the / etc/sudoers file first, as follows, to add the contents of the tag. No setting is required to use root.

[root@ticent admin] # vi / etc/sudoers

6. Remove mariadb-libs

[mysql@ticent] $sudo rpm-e mariadb-libs-5.5.52-1.el7.x86_64-- nodeps

7. Install perl

[root@ticent mysql] # yum install perl

8. Install mysql

[mysql@ticent ~] $sudo rpm-ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm

Warning: mysql-community-common-5.7.18-1.el7.x86_64.rpm: header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing. # # [100%]

Upgrading / installing...

1:mysql-community-common-5.7.18-1.e## [100%]

[mysql@ticent ~] $sudo rpm-ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm

Warning: mysql-community-libs-5.7.18-1.el7.x86_64.rpm: header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing. # # [100%]

Upgrading / installing...

1:mysql-community-libs-5.7.18-1.el7## [100%]

[mysql@ticent ~] $sudo rpm-ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm

Warning: mysql-community-client-5.7.18-1.el7.x86_64.rpm: header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing. # # [100%]

Upgrading / installing...

1:mysql-community-client-5.7.18-1.e## [100%]

[mysql@ticent ~] $sudo rpm-ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm

Warning: mysql-community-server-5.7.18-1.el7.x86_64.rpm: header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing. # # [100%]

Upgrading / installing...

1:mysql-community-server-5.7.18-1.e## [100%]

9. Initialization

[mysql@ticent] $mysqld-- initialize

10. Start the service

[mysql@ticent ~] $service mysqld start

11. View temporary password

[mysql@ticent ~] $cat / var/log/mysqld.log

twelve。 Log in with the initial password and change the password

[mysql@ticent] $mysql-u root-p

Mysql > ALTER USER 'root'@'localhost' IDENTIFIED BY' 123'

Mysql > flush privileges

13. Login verification is successful again

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