• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How To Reset MySQL Root Password In REDHAT 8.5

  • 00:02 cat /etc/os-release
  • 00:17 mysql -u root -p
  • 00:41 systemctl stop mysqld
  • 00:56 mysqld --skip-grant-tables --user=mysql &
  • 01:05 mysql -u root
  • 01:12 flush privileges;
  • 01:23 alter user 'root'@'localhost' identified by 'Linuxc#4';
  • 01:49 \q
  • 01:54 ps -aux
  • 02:02 kill -9 35564
  • 02:18 systemctl start mysqld
  • 02:35 mysql -u root -p
  • 02:52 flush privileges;
{{postValue.id}}

To Reset MySQL Root Password On REDHAT 8.5

Introduction:

MySQL is a well-known open-source relational database management system developed, distributed, and supported by Oracle Corporation which is used with PHP.

Step 1: Check the installed version of OS by using the below command

[root@linuxhelp ~]# cat /etc/os-release 
NAME="Red Hat Enterprise Linux"
VERSION="8.5 (Ootpa)"

Step 2: Try to login MySQL as root user by using the below command

[root@linuxhelp ~]# mysql -u root -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Notes: am Forget my my sql password

Step 3: Stop MySQL Service by using the below command

[root@linuxhelp ~]# systemctl stop mysqld

Step 4: Run the below command to bypass MySQL authentication

[root@linuxhelp ~]# mysqld --skip-grant-tables --user=mysql &
[1] 35564

Step 5: Login MySQL server as a root user by using the below command

[root@linuxhelp ~]# mysql -u root 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Server version: 8.0.26 Source distribution

Step 6: Flush the Privileges by using the below command

mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)

Step 7: Alter the password for root user by using the below command

mysql> alter user 'root'@'localhost' identified by 'Linuxc#4';
Query OK, 0 rows affected (0.01 sec)

Step 8: Quit MySQL server by using the below command

mysql> \q
Bye

Step 9: Check the MySQL Background process by using the below command

[root@linuxhelp ~]# ps -aux

root         190  0.0  0.0      0     0 ?        S    18:02   0:00 [irq/27-pciehp]
root         191  0.0  0.0      0     0 ?        S    18:02   0:00 [irq/28-pciehp]

root         192  0.0  0.0      0     0 ?        S    18:02   0:00 [irq/29-pciehp]
root         193  0.0  0.0      0     0 ?        S    18:02   0:00 [irq/30-pciehp]
root         194  0.0  0.0      0     0 ?        S    18:02   0:00 [irq/31-pciehp]
root       35289  0.0  0.0      0     0 ?        I    18:27   0:00 [kworker/0:0-events_power_efficient]
mysql      35564  0.8 10.0 1814108 382488 pts/1  Sl   18:28   0:01 mysqld --skip-grant-tables --user=mysql
root       35695  0.0  0.0   7316   908 ?        S    18:30   0:00 sleep 60
root       35732  0.0  0.1  61660  4112 pts/1    R+   18:30   0:00 ps -aux

Step 10: Kill The MySQL Background process by using process id

[root@linuxhelp ~]# kill -9 35564
[1]+  Killed                  mysqld --skip-grant-tables --user=mysql

Step 11: Start the MySQL service by using the below command

[root@linuxhelp ~]# systemctl start mysqld

Step 12: Login MySQL as a root user by using the below command

[root@linuxhelp ~]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8

Step 13: Flush the privileges by using the below command

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

Step 14: Quit

mysql>\q
Bye

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to Reset MySQL Root Password on REDHAT 8.5. Your feedback is much welcome.

Tags:
muhammad
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

Is it possible to reset Root's password in Mysql?

A

yes, it is possible to reset Root's password in Mysql.

Q

Can we customize the data directory path in MySQL?

A

yes, we can change it by editing the MySQL configuration file.

Q

How to backup the table in a database?

A

To backup the table in a database use mysqldump -u root -p database_name table_name > filename.sql

Q

What is the current stable version of MySQL?

A

The latest stable version of MySQL is 8.0.29

Q

What kind of Database is MySQL?

A

Mysql is a relational database system.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help keel johnston ?
Unhide the folders on windows Explorer

Give any solutions to unhide folder using command prompt?

forum3

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.