How to remove MySQL from Ubuntu and reinstall it

How to remove MySQL from Ubuntu and reinstall it

First delete mysql:

sudo apt-get remove mysql-*

Then clean up the remaining data

dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

A dialog box will pop up, just select yes.

Then install mysql

sudo apt-get install mysql-client mysql-server

You will be prompted to set a root password during installation. If you do not clean up residual data during uninstallation, you will not be prompted to set a root password.

Check if mysql is running

sudo service mysql status

Generally, it will run automatically after the installation is complete.

If it is not running you can

sudo service mysql start

Summarize

The above is the method I introduced to you to remove MySQL from Ubuntu and reinstall it. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Ubuntu18.04 installation mysql8.0.11 graphic tutorial
  • How to install MySQL on Ubuntu 18.04 (linux)
  • Ubuntu 18.04 MySQL 8.0 installation and configuration method graphic tutorial
  • Ubuntu Server 16.04 MySQL 8.0 installation and configuration graphic tutorial
  • Detailed explanation of installing and completely uninstalling mysql with apt-get under Ubuntu
  • How to install mysql5.6 in docker under ubuntu
  • MySQL and MySQL Workbench Installation Tutorial under Ubuntu
  • Solve the problem of ERROR 1045 (28000): Access denied for user ''root''@''localhost'' when logging in after installing MySQL 5.7.17 on Ubuntu 16.04
  • Tutorial on installing MySQL 5.7 on Ubuntu 16.04
  • Ubuntu 16.04.1 MySQL installation and uninstallation graphic tutorial
  • Solution to the error "libpng12-0 package not installed" when installing mysql workbench in Ubuntu 16.10

<<:  Building a KVM virtualization platform on CentOS7 (three ways)

>>:  Summary of the use of three for loop statements in JavaScript (for, for...in, for...of)

Recommend

Mysql implementation of full-text search and keyword scoring method example

1. Introduction Today a colleague asked me how to...

Detailed explanation of the installation steps of the MySQL decompressed version

1. Go to the official website: D:\mysql-5.7.21-wi...

Application examples of WeChat applet virtual list

Table of contents Preface What is a virtual list?...

Detailed analysis of binlog_format mode and configuration in MySQL

There are three main ways of MySQL replication: S...

Summary of learning Docker commands in one article

Table of contents Introduction Mirror repository ...

Docker online and offline installation and common command operations

1. Test environment name Version centos 7.6 docke...

How to manually build a new image with docker

This article introduces the method of manually bu...

MySQL index cardinality concept and usage examples

This article uses examples to explain the concept...

Detailed process of building mysql5.7.29 on centos7 of linux

1. Download MySQL 1.1 Download address https://do...

JS implements the sample code of decimal conversion to hexadecimal

Preface When we write code, we occasionally encou...

Summary of HTML horizontal and vertical centering issues

I have encountered many centering problems recent...

Highly recommended! Setup syntax sugar in Vue 3.2

Table of contents Previous 1. What is setup synta...

4 principles for clean and beautiful web design

This article will discuss these 4 principles as t...