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

Linux uses if to determine whether a directory exists.

How to use if in Linux to determine whether a dir...

Solve the pitfall of storing boolean type values ​​in localstorage

LocalStorage stores Boolean values Today, when I ...

6 ways to view the port numbers occupied by Linux processes

For Linux system administrators, it is crucial to...

Simple web page code used in NetEase blog

How to use the code in NetEase Blog: First log in...

Vue realizes click flip effect

Use vue to simply implement a click flip effect f...

The difference between the four file extensions .html, .htm, .shtml and .shtm

Many friends who have just started to make web pag...

Linux installation MySQL tutorial (binary distribution)

This tutorial shares the detailed steps of instal...

Linux Dig command usage

Dig Introduction: Dig is a tool that queries DNS ...

Install mysql5.7.13 using RPM in CentOS 7

0. Environment Operating system for this article:...

Several implementation methods of the tab bar (recommended)

Tabs: Category + Description Tag bar: Category =&...

Methods and steps for deploying GitLab environment based on Docker

Note: It is recommended that the virtual machine ...

VMware installation of Ubuntu 20.04 operating system tutorial diagram

Memo: Just experience it. Record: NO.209 This exa...

HTML/CSS Basics - Several precautions in HTML code writing (must read)

The warning points in this article have nothing t...

WeChat applet realizes the effect of swiping left to delete list items

This article shares the specific code for WeChat ...

Detailed explanation of Nginx http resource request limit (three methods)

Prerequisite: nginx needs to have the ngx_http_li...