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

Summary of pits encountered in centos7 installation of mysql and mysqlclient

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

Share

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

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

These are some of the pitfalls encountered in centos7 installation of mysql and mysqlclient and a summary of the knowledge points that need to be paid attention to. Thank you for your reading and 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: 228

*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

Servers

Wechat

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

12
Report