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

HTML text escape tips

Today I saw a little trick for HTML text escaping ...

Velocity.js implements page scrolling switching effect

Today I will introduce a small Javascript animati...

How to enable TLS and CA authentication in Docker

Table of contents 1. Generate a certificate 2. En...

How to start a Java program in docker

Create a simple Spring boot web project Use the i...

How to make if judgment in js as smooth as silk

Table of contents Preface Code Implementation Ide...

MySQL simple example of sorting Chinese characters by pinyin

If the field storing the name uses the GBK charac...

Detailed explanation of the use of MySQL sql_mode

Table of contents Preface sql_mode explained The ...

Details on how to write react in a vue project

We can create jsx/tsx files directly The project ...

Implementation of HTML sliding floating ball menu effect

CSS Styles html,body{ width: 100%; height: 100%; ...

WeChat applet implements simple chat room

This article shares the specific code of the WeCh...

Using JS timer to move elements

Use JS timer to make an element to make a method ...

Three Discussions on Iframe Adaptive Height Code

When building a B/S system interface, you often en...

The difference between datatime and timestamp in MySQL

There are three date types in MySQL: date(year-mo...