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 solve the pits encountered in centos7 installation of mysql and mysqlclient

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the centos7 installation of mysql and mysqlclient encountered in the pit how to solve the relevant knowledge, the content is detailed and easy to understand, simple and fast operation, with a certain reference value, I believe that everyone after reading this centos7 installation of mysql and mysqlclient encountered in the pit how to solve the article will have a harvest, let's take a look.

1. Add mysql yum Feed

Mysql official website > downloads > mysql yum repository find the appropriate version of yum source

$wget https://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm$sudo rpm-uvh mysql80-community-release-el7-2.noarch.rpm # View mysql database version information $yum repolist all | grep mysql

two。 Select the installation version

Modify the / etc/yum.repos.d/mysql-community.repo file and select the mysql5.7 version

# enable to use mysql 5.6 [mysql56-community] name=mysql 5.6 community serverbaseurl= http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/enabled=0 # prohibit gpgcheck=1gpgkey= file:///etc/pki/rpm-gpg/rpm-gpg-key-mysql # enable to use mysql 5.7 [mysql57-community] name=mysql 5.7 community serverbaseurl= http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/enabled=1 # install gpgcheck=1gpgkey=file: / / etc/pki/rpm-gpg/rpm-gpg-key-mysql [mysql80-community] name=mysql 8.0 community serverbaseurl= http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch/enabled=0 # prohibit gpgcheck=1gpgkey= file:///etc/pki/rpm-gpg/rpm-gpg-key-mysql

3. Installation

# execute the following command to install mysqlyum install mysql-community-server# startup mysql (in centos7) systemctl start mysqld.service# low-version operating system can use the following instruction service mysqld start# to view mysql status systemctl status mysqld.service# low-version operating system available the following instruction service mysqld status

4. View and change password

$grep "password" / var/log/mysqld.log2019-04-11t08:17:16.706096z 1 [note] a temporary password is generated for root@localhost: ux#bkam (k1q-$mysql-u root-p > ux#bkam (k1q-# change password mysql > alter user 'root'@'localhost' identified by' complex password';mysql > set global validate_password_policy=0;mysql > set global validate_password_length=1;mysql > alter user 'root'@'localhost' identified by' simple password'

5. Configure open port 3306

Authorization allows any host to access the mysql server: [generally, port access is restricted to firewalld]

Mysql > grant all privileges on *. * to 'root'@'%' identified by' password' with grant option

Restrict ip access:

Mysql > grant all privileges on *. * to 'jack'@'10.10.50.127' identified by' password' with grant option; on "centos7 installation mysql and mysqlclient encountered how to solve the hole" this article is introduced here, thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to solve the pitfalls encountered in centos7 installation mysql and mysqlclient". If you want to learn more, you are welcome to follow the industry information channel.

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

Internet Technology

Wechat

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

12
Report