Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Troubleshooting CentOS

You're reading from   Troubleshooting CentOS A practical guide to troubleshooting the CentOS 7 community-based enterprise server

Arrow left icon
Product type Paperback
Published in Jun 2015
Publisher
ISBN-13 9781785289828
Length 190 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Jonathan Hobson Jonathan Hobson
Author Profile Icon Jonathan Hobson
Jonathan Hobson
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Basics of Troubleshooting CentOS FREE CHAPTER 2. Troubleshooting Active Processes 3. Troubleshooting the Network Environment 4. Troubleshooting Package Management and System Upgrades 5. Troubleshooting Users, Directories, and Files 6. Troubleshooting Shared Resources 7. Troubleshooting Security Issues 8. Troubleshooting Database Services 9. Troubleshooting Web Services 10. Troubleshooting DNS Services Index

Resetting and recovering a root password with MariaDB


The act of resetting a root password provides true currency for a system troubleshooter. It can happen—and yes, it does happen more times than you can imagine—but by following the next few steps, a crisis can be averted.

To begin, you will need to stop the MariaDB service like this:

# systemctl stop mariadb.service

The next step is to activate "safe mode" in the following way:

# mysqld_safe --skip-grant-tables --skip-networking

Now run the following sequence to access the MySQL console and connect to the database:

# mysql -u root
# use mysql;

At this point, we now want to create a new password for the root user, flush the new privileges, and exit the MySQL console like this:

# update user set password=PASSWORD("NEW_PASSWORD") where User='root';
# flush privileges;
# exit

Having completed these steps, you can either reboot the server or simply stop and start the MariaDB service in the following way:

# systemctl stop mariadb.service
# systemctl...
lock icon The rest of the chapter is locked
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 $19.99/month. Cancel anytime
Banner background image