Methods and problems encountered in installing mariadb in centos under mysql

Methods and problems encountered in installing mariadb in centos under mysql

Delete the previously installed mariadb

1. Use rpm -qa | grep mariadb to search for the existing MariaDB package:

If it exists, use rpm -e --nodeps mariadb-*全部刪除:

[root@localhost ~]# rpm -qa | grep mariadb
mariadb-server-5.5.52-1.el7.x86_64
mariadb-libs-5.5.52-1.el7.x86_64
[root@localhost ~]# rpm -e mysql-*
Error: Package mysql-* not installed

2. Use rpm -qa | grep mariadb to search for the existing MariaDB package:

If it exists, use yum remove mysql mysql-server mysql-libs compat-mysql51 to delete all;

[root@localhost ~]# yum remove mysql mysql-server mysql-libs compat-mysql51
Loaded plugins: fastestmirror, langpacks
Parameter mysql has no match Parameter mysql-server has no match Parameter compat-mysql51 has no match Resolving dependencies
--> Checking transactions
---> Package mariadb-libs.x86_64.1.5.5.52-1.el7 will be removed
--> Processing dependency libmysqlclient.so.18()(64bit) required by package perl-DBD-MySQL-4.023-5.el7.x86_64
--> Processing dependency libmysqlclient.so.18()(64bit), required by package 2:postfix-2.10.1-6.el7.x86_64
--> Processing dependency libmysqlclient.so.18()(64bit), required by package 1:qt-mysql-4.8.5-13.el7.x86_64..........

Install mariadb

Installation command:

Copy the code as follows:

yum -y install mariadb mariadb-server


Start command:

Copy the code as follows:

systemctl start mariadb


Add startup

Copy the code as follows:

systemctl enable mariadb


Simple configuration

Copy the code as follows:

mysql_secure_installation

Enter command line mode

mysql -uroot -p

Problems encountered

Host is not allowed to connect to this MySQL server

MySQL does not allow remote login, so remote login fails. The solution is as follows:

Log in to MySQL on the machine where MySQL is installed. mysql -u root -p password and execute use mysql;
Execute update user set host = '%' where user = 'root'; This statement may display an error message after execution, so ignore it.
Execute FLUSH PRIVILEGES;
After the above 4 steps, this problem can be solved.
Note: The fourth step is to refresh the MySQL permission-related tables. Don’t forget it. I didn’t execute the fourth step the first time, and it was always unsuccessful. I finally found the reason.

Summarize

The above is the method and problems encountered in installing mariadb under centos under mysql introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • MySQL 5.6 binary installation process under Linux
  • Graphic tutorial on installing the latest version of MySQL server on Windows 7 64 bit
  • Detailed explanation of the idea of ​​installing mysql8.0.11 and changing the root password and connecting navicat for mysql
  • Solve the problem of Ubuntu pip installing mysql-python package
  • Package example of installing mysql-python under Anaconda
  • Summary of the installation process of MySql 8.0.11 and the problems encountered when linking with Navicat
  • MySQL green decompression version installation and configuration steps
  • Ubuntu 18.04 MySQL 8.0 installation and configuration method graphic tutorial
  • MySQL 8.0.11 compressed version installation and configuration method graphic tutorial
  • MySQL Community Server 8.0.11 installation and configuration method graphic tutorial
  • Detailed installation process of MySQL 8.0 Windows zip package version
  • MySQL 5.7.21 decompression version installation and configuration method graphic tutorial
  • MySQL 8.0.11 Installation Tutorial under Windows
  • Detailed tutorial for installing MySQL 8.0.11 compressed version under win10
  • MySQL installation diagram summary

<<:  Docker Basic Tutorial: Detailed Explanation of Dockerfile Syntax

>>:  How to use Webstorm and Chrome to debug Vue projects

Recommend

How to implement form validation in Vue

1. Installation and use First, install it in your...

CentOS 8 officially released based on Red Hat Enterprise Linux 8

The CentOS Project, a 100% compatible rebuild of ...

Sample code for easily implementing page layout using flex layout

Without further ado, let's get straight to th...

Detailed explanation of Bootstrap grid vertical and horizontal alignment

Table of contents 1. Bootstrap Grid Layout 2. Ver...

HTML table tag tutorial (33): cell vertical alignment attribute VALIGN

In the vertical direction, you can set the cell a...

Docker container orchestration implementation process analysis

In actual development or production environments,...

Detailed explanation of Linux system directories sys, tmp, usr, var!

The growth path from a Linux novice to a Linux ma...

MAC+PyCharm+Flask+Vue.js build system

Table of contents Configure node.js+nvm+npm npm s...

Use js to write a simple snake game

This article shares the specific code of a simple...

Linux kernel device driver advanced character device driver notes

/****************** * Advanced character device d...

MySQL 8.0 New Features: Hash Join

The MySQL development team officially released th...

Element Table table component multi-field (multi-column) sorting method

Table of contents need: Problems encountered: sol...

Vue3 uses axios interceptor to print front-end logs

Table of contents 1. Introduction 2. Use axios in...