CentOS8 install MySQL8 (pro test)

If you are still looking for a tutorial to install MySQL on CentOS and can’t find it, then you don’t need to turn it around if you see it here.
To be honest, I have been doing it for a day today.

Article Directory###

Download MySQL

Download link of MySQL8.0.21 versions: click here

Pull this drop-down box, Fedora, Unbuntu have everything, anyway, you can't find centOS, right? Then there are a bunch of people on the Internet saying that centOS supports mariaDB by default. Anyway, my CentOS does not have it.

Do this:

It can be downloaded directly under Linux system.


Start configuration##

First, check if there is MariaDB in your system:

rpm -qa | grep mariadb

If there is, it will give you a version of the response, if not, there will be no.

If you are lucky, and you really have it, then uninstall it: rpm -e version number --nodeps


Create a directory, called mysql, where you can remember it.
Then drag the downloaded installation package of MySQL to your mysql directory, you can drag it in with the code, or you can drag it in the file manager.

Unzip: tar -xvf mysql-8.0.21-1.el7.x86_64.rpm-bundle.tar
Other people’s pictures mean the same


Install common through the rpm -ivh mysql-community-common-8.0.21-1.el7.x86_64.rpm --nodeps --force command

Install libs through the rpm -ivh mysql-community-libs-8.0.11-1.el7.x86_64.rpm --nodeps --force command

Install the client through the rpm -ivh mysql-community-client-8.0.11-1.el7.x86_64.rpm --nodeps --force command

Install the server through the rpm -ivh mysql-community-server-8.0.11-1.el7.x86_64.rpm --nodeps --force command

View the mysql installation package through the rpm -qa | grep mysql command


Through the following commands, complete the initialization and related configuration of the mysql database

mysqld --initialize;
chown mysql:mysql /var/lib/mysql -R;
systemctl start mysqld.service;
systemctl enable mysqld;


View the password of the database through the cat /var/log/mysqld.log | grep password command


Enter the database login interface through mysql -uroot -p and press Enter

Enter the password you just found to log in to the database, just copy and paste. The MySQL login password is not displayed.

Modify the password through the ALTER USER'root'@'localhost' IDENTIFIED WITH mysql_native_password BY'root'; command
Now the password is changed to root

Exit MySQL with the exit; command, and then log in again with the new password


Through the following command, remote access authorization


Add remote login user

By default, only the root account is allowed to log in locally. If you want to connect to mysql on other machines, you must modify root to allow remote connections, or add an account that allows remote connections.

Modify the remote access permissions of the root user:

Select the mysql database: use mysql;

View the relevant information of the current root user in the user table of the mysql database:

select host, user from user;

Check the host of the root user in the table. The localhost should be displayed by default. It only supports local access and does not allow remote access.

Authorize all permissions of the root user and set up remote access

GRANT ALL ON *.* TO 'root'@'%';

If an error is reported: ERROR 1410 (42000): You are not allowed to create a user with GRANT

update user set host='%' where user ='root';

Then use the following command to make the changes take effect:

flush privileges;

If necessary, execute the command that was previously authorized to report an error to be successful, and finally use flush privileges; command to refresh.


Sqlyog link 2058 exception

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

The password is the password you modified. Then reconnect in SQLyog, the connection can be successful, OK.

If an error is reported: ERROR 1396 (HY000): Operation ALTER USER failed for'root'@'localhost' then use the following command:

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

Recommended Posts

CentOS8 install MySQL8 (pro test)
CentOS7.2 install Mysql5.7.13
CentOS7 install MySQL
CentOS install mysql
CentOS7 install mysql
CentOS 7 install MySQL 5.6
CentOS8 install MySQL8.0
CentOS7 install mysql8
CentOS7 install MySQL8
centos 7.5 install mysql5.7.17
CentOS6.5 offline install MySQL5.6.26
Install MySQL5.7 in centos7
Install mysql5.7 under CentOS7
Centos7 install Mysql8 tutorial
Centos manually install mysql8
Install mysql under Centos 7
Centos7 install Mysql database
Install mysql5.1 under CentOS6.5
Install mysql online on centos
centos install mysql through yum
Install MySQL 8.0.16 on Linux Centos
Install MySQL under Linux (CentOS 7)
Centos6 install mysql 5.7.x series
1.5 Install Centos7
How to install MySQL on CentOS 8
CentOS7 yum install and start mysql
CentOS Yum compile and install MySQL 5.6
Install MySql with Docker in CentOS7
Install MySQL on Linux CentOS7 (Windows)
CentOS7 yum install and start mysql
Centos7 and centos8 install mysql5.6 5.7 8.0 so simple
Centos yum install mysql5.6 or above
centos7 .*tar package to install MySQL5.7
Centos6 install Python2.7.13
Centos7.3 install nginx
Centos7 install Python 3.6.
Centos7 install protobuf
CentOS 7 install Docker
CentOS yum install Apache + PHP + Tomcat7 + MySQL
CentOS7 install GlusterFS
CentOS7 install Docker
Centos6.5 install Tomcat
CentOS install Python 3.6
Vmware install CentOS6
centos7 install docker-ce 18.01.0
CentOS 7.2 install MariaDB
CentOS7.5 source code compile and install mysql5.7.29
CentOS 7 install Hadoop 3.0.0
Centos7 install Python2.7
Centos 7.6 install seleniu
Install mysql8.0.13 version under Linux CentOS7 system
CentOS 7.3 install Zabbix3
Centos7 install LAMP+PHPmyadmin
Centos7 compile and install MySQL8 problem record
CentOS install openjdk 1.8
CENTOS6.5 install CDH5.12.1 (1)
CentOS install PHP
Centos7 install Docker
centOs install rabbitMQ
Centos7 install Nginx
CentOS6.5 install CDH5.13