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 and configure mysql server in linux system

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

Share

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

This article is to share with you the detailed tutorial of installing and configuring mysql server in linux system. I believe most people don't know how to install it yet. In order to let you learn, I summarized the following contents. Without saying much, let's read on.

Download the mysql installation package on the official website

The following figure is an introduction to the mysql installation package

Second, install the software package

1. Installation dependency

# yum-y install perl-Date-Dumper perl-JSON perl-Time-HiRes

2. Extract the mysql installation package

# tar-xvf mysql-5.7.24.tar / / extract the mysql package

3. Uninstall the old version of the package

[root@localhost ~] # rm-rf / etc/my.cnf

4. Delete data

[root@localhost ~] # rm-rf / var/lib/mysql/*

5. Uninstall the package (no uninstalled package will be shown)

[root@localhost] # rpm-e-nodeps mariadb-server mariadb

Warning: / var/log/mariadb/mariadb.log has been saved as / var/log/mariadb/mariadb.log.rpmsave

# yum-y remove mariadb-libs.x86_64 1VR 5.5.52-1.el7

6. Yum source installation

# yum-y install mysql-community-client mysql-community-common mysql-community-devel mysql-community-embedded mysql-community-embedded-compat mysql-community-embedded-devel mysql-community-libs mysql-community-libs-compat mysql-community-minimal-debuginfo mysql-community-server mysql-community-test

Or

# yum-y install mysql-community-*.rpm

7. Check the installed mysql installation packages

# rpm-qa | grep-y mysql

8. Start the service

# systemctl start mysqld# systemctl enable mysqld / / set self-boot # systemctl status mysqld [root@proxy mysql] # ss-antulp | grep mysqld / / View service startup port # ps aux | grep mysqld / / check the process

Connect to the database

1. Check the randomly generated root password

# grep password / var/log/mysqld.log# grep 'temporary password' / var/log/mysqld.log / / randomly generated administrative password

Log in to mysql with the initial password:

(! Login with a randomly generated password must change the password management immediately, otherwise an error will be reported)

2. Client command mysql to connect to the database

# mysql-hlocalhost-uroot-pamphpIhMurecoveri2OScalligrad'/ / Log in to mysql with the initial password >\ h / / after logging in successfully, check available shortcuts

IV. Change the password

1. You can only fix the password first.

Mysql > alter user root@ "localhost" identified by "123qqq...A"

2. You can change the password to limit the length.

Mysql > show variables like "% password%"; / / query password related variables mysql > set global validate_password_policy=0; / / only authentication length mysql > set global validate_password_length=6; / / modify password length to 6 digits mysql > alter user root@ "localhost" identified by "123456"; / / modify root password to 123456

This is the end of the tutorial on installing and configuring the mysql server in the linux system. I hope the above content can be of some help and learn more. If you think the article is good, you can share it for more people to see.

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