Summary of pitfalls encountered in installing mysql and mysqlclient on centos7

Summary of pitfalls encountered in installing mysql and mysqlclient on centos7

1. Add MySQL Yum repository

MySQL official website>DOWNLOADS>MySQL Yum RepositoryFind the yum source of the appropriate version

$wget https://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm
$ sudo rpm -Uvh mysql80-community-release-el7-2.noarch.rpm
 
#View the various versions of the MySQL database $yum repolist all | grep mysql

2. Select the installation version

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

# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/
enabled=0 # Disable gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
 
# Enable to use MySQL 5.7
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
enabled=1 # Install gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
 
[mysql80-community]
name=MySQL 8.0 Community Server
baseurl=http://repo.mysql.com/yum/mysql-8.0-community/el/7/$basearch/
enabled=0 # Disable gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

3. Installation

#Execute the following command to install MySQL
yum install mysql-community-server
#Start mysql (in CentOS7)
systemctl start mysqld.service
# For lower version operating systems, you can use the following command service mysqld start
#Check MySQL status systemctl status mysqld.service
# For lower version operating systems, you can use the following command: service mysqld status

4. Check and modify password

$grep "password" /var/log/mysqld.log
2019-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 passwordmysql>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 to open port 3306

The authorization method allows any host to access the MySQL server: [Generally, this is enough, and firewalld is responsible for limiting port access]

mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

Limit IP access:

mysql>GRANT ALL PRIVILEGES ON *.* TO 'jack'@'10.10.50.127' IDENTIFIED BY 'password' WITH GRANT OPTION;

The above is a summary of some pitfalls and knowledge points that need to be paid attention to when installing MySQL and MySQLclient on CentOS 7. Thank you for your reading and support for 123WORDPRESS.COM.

<<:  Summary of JavaScript JSON.stringify() usage

>>:  Detailed explanation of four solutions for MySQL active-active synchronous replication

Recommend

Detailed explanation of global parameter persistence in MySQL 8 new features

Table of contents Preface Global parameter persis...

How to insert Emoji expressions into MySQL

Preface Today, when I was designing a feedback fo...

Vue recursively implements custom tree components

This article shares the specific code of Vue recu...

Example of how to modify styles via CSS variables

question How to modify CSS pseudo-class style wit...

Using MySQL database in docker to achieve LAN access

1. Get the mysql image docker pull mysql:5.6 Note...

Detailed explanation of mysql replication tool based on python

Table of contents 1. Introduction Second practice...

A comprehensive summary of frequently used statements in MySQL (must read)

The knowledge points summarized below are all fre...

Detailed explanation of common usage of pseudo-classes before and after in CSS3

The before/after pseudo-class is equivalent to in...

Vue-CLI multi-page directory packaging steps record

Page directory structure Note that you need to mo...

mysql group by grouping multiple fields

In daily development tasks, we often use MYSQL...

How to connect Navicat to the docker database on the server

Start the mysql container in docekr Use command: ...

Examples of some usage tips for META tags in HTML

HTML meta tag HTML meta tags can be used to provi...

About the problem of vertical centering of img and span in div

As shown below: XML/HTML CodeCopy content to clip...

Keepalived implements Nginx load balancing and high availability sample code

Chapter 1: Introduction to keepalived The purpose...