Install mysql5.7.17 using RPM under Linux

Install mysql5.7.17 using RPM under Linux

The installation method of MySQL5.7 rpm under Linux is recorded for your reference. The specific contents are as follows

Remove the old package:

# rpm -qa | grep -i mysql
# rpm -ev mysql-libs-* --nodeps

Install the rpm package:

# rpm -ivh mysql-community-common-5.7.17-1.el7.x86_64.rpm
# rpm -ivh mysql-community-libs-5.7.17-1.el7.x86_64.rpm
# rpm -ivh mysql-community-client-5.7.17-1.el7.x86_64.rpm
# rpm -ivh mysql-community-server-5.7.17-1.el7.x86_64.rpm

Start, stop:

# service mysqld start
# service mysqld stop
# service mysqld status

Initial random password:

# cat /var/log/mysqld.log | more

Modify the initial password and authorize remote access:

#mysql -uroot -p
mysql> set password='Pwd@123456';
mysql> grant all privileges on *.* to 'root'@'%' identified by 'Pwd@123456';

Password complexity attributes:

mysql> set global validate_password_policy=0;

validate_password_policy has the following values: (The default is 1, which is MEDIUM, so the password you set at the beginning must meet the length requirements and must contain numbers, lowercase or uppercase letters, and special characters.)

Modify the data directory:

The new directory needs to authorize the mysql user, authorize the mysqld_safe log file, and turn off selinux (no method for related policy settings was found)

# mkdir /data/mysql/data
# mv /var/lib/mysql/* /data/mysql/data/
# mkdir /data/mysql/log
# chown mysql:mysql -R /data/mysql
# touch mysqld_safe.log
# chown mysql:mysql mysqld_safe.log
# vi /etc/my.cnf
/**
[client]
port = 3306
socket = /data/mysql/log/mysql.sock
default-character-set=utf8

[mysql]
no-auto-rehash
socket=/data/mysql/log/mysql.sock
default-character-set=utf8

[mysqld]
port = 3306
socket = /data/mysql/log/mysql.sock
character-set-server=utf8
lower_case_table_names=1
basedir=/usr
datadir=/data/mysql/data
log-error=/data/mysql/log/error.log
pid-file=/data/mysql/log/mysql.pid
init_connect='SET NAMES utf8'
symbolic-links=0

skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M

[mysqld_safe]
log-error=/data/mysql/log/mysqld_safe.log
*/
# getenforce
Enforcing
# setenforce 0
# vi /etc/selinux/config
/**
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
#SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted 
*/
# service mysqld start

Other commands:

# mysqladmin -u root -p password
mysql> select version();


# chkconfig --list
# chkconfig --level 345 mysqld on
# netstat -na | grep 3306

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • A detailed introduction to the three installation methods of rpm, yum and source code under Linux
  • How to check whether a certain software has been installed by yum/rpm/dpkg in Linux
  • Summary of RPM package installation, query and uninstallation commands in Linux and detailed explanation of yum command
  • RPM packaging process under Linux
  • RPM installation command in Linux command
  • Detailed explanation of how to install software tar.gz, rpm, deb under Linux
  • Detailed explanation of Linux rpm and yum commands and usage

<<:  HTTP and HTTP Collaboration Web Server Access Flow Diagram

>>:  Detailed explanation of using JavaScript WeakMap

Recommend

Implement a simple search engine based on MySQL

Table of contents Implementing a search engine ba...

js array fill() filling method

Table of contents 1. fill() syntax 2. Use of fill...

How to move a red rectangle with the mouse in Linux character terminal

Everything is a file! UNIX has already said it. E...

js to achieve simple front-end paging effect

Some projects have relatively simple business, bu...

MySQL 8.0.15 version installation tutorial connect to Navicat.list

The pitfalls 1. Many tutorials on the Internet wr...

CSS3+Bezier curve to achieve scalable input search box effect

Without further ado, here are the renderings. The...

Ideas and methods for incremental backup of MySQL database

To perform incremental backup of the MySQL databa...

A brief discussion on the definition and precautions of H tags

Judging from the results, there is no fixed patte...

Summary of ten principles for optimizing basic statements in MySQL

Preface In the application of database, programme...

Master the CSS property display:flow-root declaration in one article

byzhangxinxu from https://www.zhangxinxu.com/word...

37 Tips for a Good User Interface Design (with Pictures)

1. Try to use single column instead of multi-colum...

How to install Mysql5.7 in Centos6

environment Centos 6.6 MySQL 5.7 Install If the s...

Alibaba Cloud domain name and IP binding steps and methods

1 Enter the Alibaba Cloud console, find the domai...