Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
MySQL 8 Cookbook

You're reading from  MySQL 8 Cookbook

Product type Book
Published in Jan 2018
Publisher
ISBN-13 9781788395809
Pages 446 pages
Edition 1st Edition
Languages
Author (1):
Karthik Appigatla Karthik Appigatla
Profile icon Karthik Appigatla
Toc

Table of Contents (20) Chapters close

Title Page
Dedication
Packt Upsell
Contributors
Preface
1. MySQL 8 - Installing and Upgrading 2. Using MySQL 3. Using MySQL (Advanced) 4. Configuring MySQL 5. Transactions 6. Binary Logging 7. Backups 8. Restoring Data 9. Replication 10. Table Maintenance 11. Managing Tablespace 12. Managing Logs 13. Performance Tuning 14. Security Index

Uninstalling MySQL 8


If you have messed up with installation or you do not want MySQL 8 version, you can uninstall using the following steps. Before uninstalling, make sure to make backup files (refer to Chapter 7, Backups), if required, and stop MySQL.

How to do it...

Uninstalling will be dealt in a different way on different systems. Let's look at how.

On YUM-based systems

  1. Check whether there are any existing packages:
shell> rpm -qa | grep -i mysql-community
mysql-community-libs-8.0.3-0.1.rc.el7.x86_64
mysql-community-common-8.0.3-0.1.rc.el7.x86_64
mysql-community-client-8.0.3-0.1.rc.el7.x86_64
mysql-community-libs-compat-8.0.3-0.1.rc.el7.x86_64
mysql-community-server-8.0.3-0.1.rc.el7.x86_64
  1. Remove the packages. You may be notified that there are other packages dependent on MySQL. If you plan on installing MySQL again, you can ignore the warning by passing the --nodeps option:
shell> rpm -e <package-name>

For example:

shell> sudo rpm -e mysql-community-server
  1. To remove all packages:
shell> sudo rpm -qa | grep -i mysql-community | xargs sudo rpm -e --nodeps
warning: /etc/my.cnf saved as /etc/my.cnf.rpmsave

On APT-based systems

  1. Check whether there are any existing packages:
shell> dpkg -l | grep -i mysql
  1. Remove the packages using the following:
shell> sudo apt-get remove mysql-community-server mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-server mysql-community-server-core -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  mysql-client mysql-common mysql-community-client mysql-community-client-core mysql-community-server mysql-community-server-core mysql-server
0 upgraded, 0 newly installed, 7 to remove and 341 not upgraded.
After this operation, 357 MB disk space will be freed.
(Reading database ... 134358 files and directories currently installed.)
Removing mysql-server (8.0.3-rc-1ubuntu16.04) ...
Removing mysql-community-server (8.0.3-rc-1ubuntu16.04) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Removing mysql-client (8.0.3-rc-1ubuntu16.04) ...
Removing mysql-community-client (8.0.3-rc-1ubuntu16.04) ...
Removing mysql-common (8.0.3-rc-1ubuntu16.04) ...
Removing mysql-community-client-core (8.0.3-rc-1ubuntu16.04) ...
Removing mysql-community-server-core (8.0.3-rc-1ubuntu16.04) ...
Processing triggers for man-db (2.7.5-1) ...

Or remove them using:

shell> sudo apt-get remove --purge mysql-\* -y
shell> sudo apt-get autoremove -y
  1. Verify that the packages are uninstalled:
shell> dpkg -l | grep -i mysql
ii  mysql-apt-config        0.8.9-1               all          Auto configuration for MySQL APT Repo.
rc  mysql-common            8.0.3-rc-1ubuntu16.04 amd64        MySQL Common
rc  mysql-community-client  8.0.3-rc-1ubuntu16.04 amd64        MySQL Client
rc  mysql-community-server  8.0.3-rc-1ubuntu16.04 amd64        MySQL Server

rc indicates that the packages have been removed (r), and only config files (c) have been kept.

Uninstalling Binaries

It is very simple to uninstall a binary installation. All you need to do is to remove the symlink:

  1. Change the directory to the installation path:
shell> cd /usr/local
  1. Check where mysql is pointing to, which will show the path it is referencing to:
shell> sudo ls -lh mysql
  1. Remove mysql:
shell> sudo rm mysql
  1. Remove the binaries (optional):
shell> sudo rm -f /opt/mysql-8.0.3-rc-linux-glibc2.12-x86_64.tar.gz
You have been reading a chapter from
MySQL 8 Cookbook
Published in: Jan 2018 Publisher: ISBN-13: 9781788395809
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}