Mysql8.0.15 installation configuration (centos7)

Centos 7 no longer pre-installs mysql

I uninstalled the original mariadb (because I... failed to download mysql directly when adding mysql yum source)

yum -y remove mariadb

Go to the official website to download the yum rpm package of mysql

# mysql80-community-release-el7-2.noarch.rpm#You can use this to download wget directly'http://repo.mysql.com/mysql80-community-release-el7-2.noarch.rpm'

https://dev.mysql.com/downloads/file/?id=482300

download

# mysql-community-server-8.0.15-1.e17.x86_64.rpm
Download the rpm package after it cannot be downloaded normally

https://dev.mysql.com/downloads/file/?id=484547

use

rpm -ivh mysql80-community-release-el7-2.noarch.rpm install mysql yum source

Then you can use

yum install mysql-community-server download and install

( If your network is fast, it can be done all at once, of course, configured, yum mirror source)

Of course you can go to the official website to download the rpm package

Installed!

Start mysql service

service mysqld start

Check service status

systemctl status mysqld

shut down

service mysqld stop

Reboot

service mysqld restart 

Can modify the configuration

vim /etc/my.cnf

If this error occurs,

reference

https://www.linuxidc.com/Linux/2010-06/26890.htm

rm -rf /var/lib/mysql/* 

rm /var/lock/subsys/mysqld 

killall mysqld

service mysqld start 

Set mysql to boot up

systemctl enable mysqld

systemctl daemon-reload

change Password

grep"A temporary password is generated for root@localhost" /var/log/mysqld.log

My password here is the string after the colon in red font, you can select them to copy

Then type

mysql -uroot -p 

Press Enter and then paste the password

Change the root password:

ALTERUSER'root'@'localhost' IDENTIFIED BY 'Your password';

Create a new user:

CREATEUSER'You create a username'@'%' IDENTIFIED BY 'password';

Give this new user remote login permissions:

GRANTALLON*.*TO'Username just created'@'%';

Take a look at user

use mysql;selectuser,host,plugin fromuser;

The host column is the specified login ip, for example, user=root host=192.168.1.1. This means that the root user can only access through the 192.168.1.1 client, and% is a wildcard, if host=192.168.1.1 1.%, then it means that as long as the client whose ip is host=192.168.1. prefix can connect, then host=% means that all ips have the right to connect, which is why when the remote connection is turned on , Most people directly change the host to% because it saves trouble

The encoding defaults to utf8mb4, no need to change

The client does not support the encryption method of caching_sha2_password

Change the password encryption method to mysql_native_password

View password verification restrictions

SHOW VARIABLES LIKE'validate_password%';

Set the strength of the verification password, the default is medium,

0 /LOW: Only verify the length;

1 /MEDIUM: verify length, numbers, capitalization, and special characters;

2 /STRONG: Verify length, numbers, capitalization, special characters, dictionary files;

setglobal validate_password.policy=LOW;

Otherwise it's annoying to appear all day long. .

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

Modify encryption policy

ALTERUSER'Your username'@'%' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;

ALTER USER 'username'@'%' IDENTIFIED WITH mysql_native_password BY 'password';

FLUSH PRIVILEGES;

Remote connection is ok

Recommended Posts

Mysql8.0.15 installation configuration (centos7)
Centos mysql installation and configuration
Centos MySQL8 configuration
Centos7 mysql database installation and configuration
MySQL 8.0 installation, deployment and configuration under CentOS 6/7
Centos7 installation and configuration prometheus
CentOS 6.x installation mysql5.7 record
CentOS installation and configuration cmake
CentOS mysql configuration master-slave replication
2019-07-09 CentOS7 installation
centos7_1708 installation
MySQL 8.0 installation, deployment and configuration tutorial on CentOS 8
Centos7 installation and configuration of Jenkins
Centos7 hadoop cluster installation and configuration
Java-JDK installation and configuration under CentOS
CentOS 7 Tomcat service installation and configuration
The latest Centos7 installation Mysql8 guide
CentOS NTP server installation and configuration
[Switch] CentOS7 64-bit installation mysql tutorial
CentOS7 install MySQL
CentOS7.0 network configuration
CentOS 7.0 network configuration
Python - centos6 installation
CentOS install mysql
Docker installation (CentOS7 installation)
CentOS7 install mysql
CentOS 7 install MySQL 5.6
CentOS8 install MySQL8.0
CentOS7 install mysql8
CentOS7 docker installation
CentOS7 install MySQL8
centos 7.5 install mysql5.7.17
Installation and use of Mysql under CentOS
Tomcat installation and configuration under CentOS 7 (Tomcat startup)
Centos7.5 configuration java environment installation tomcat explanation
Installation and configuration of redis under centos7
CentOS container installation in Docker uses MySQL
Centos7 hive stand-alone mode installation and configuration
Novice learning Linux (eight) ---- MySql installation (Centos7)
CentOS online installation RabbitMQ3.7
Installation and configuration of JDK in CentOS 7 system
Xfs configuration on centos7
Zabbix 2.2.20 installation details (Centos6.9)
CentOS6.5 offline install MySQL5.6.26
Install MySQL5.7 in centos7
Install mysql5.7 under CentOS7
CentOS 6.5 system installation and configuration graphic tutorial (detailed graphic)
Centos kernel compilation configuration
Centos source installation Python3
lamp (centos7) installation lamp environment
CentOS 7.2 Yum install MySQL 5.6
Centos7 install Mysql8 tutorial
CentOS 7 installation and configuration graphic tutorials under VMware10
Centos7 mqtt cluster installation
Graphical installation of CentOS8
Centos manually install mysql8
Install mysql under Centos 7
CentOS7 reset MySQL8.0 password
Centos7 install Mysql database
Linux notes (1): CentOS-7 installation
Installation and configuration of rsync server under CentOS 6.5