• 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 MariaDB root Login Password

  • 00:29 systemctl stop mariadb
  • 00:37 mysqld_safe --skip-grant-tables &
  • 00:56 mysql -u root
  • 01:18 update user SET PASSWORD=PASSWORD('LINUX') WHERE user="root"
{{postValue.id}}

How To Reset The MariaDB Root Login Password

Pre-requisite:

MariaDB

Procedure:

First Stop the service of MariaDB

[root@linuxhelp ~]# systemctl stop mariadb

Skip the Grant tables and restart the service of Mariadb using the below command.


 [root@linuxhelp ~]# mysqld_safe --skip-grant-tables &
[1] 31918

190803 10:09:10 mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
190803 10:09:10 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

Login to the MariaDB database using the following command

 [root@linuxhelp ~]# mysql -u root

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 1
Server version: 5.5.60-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Switch Over to the mysql database

MariaDB [(none)]> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

Change the Password of root using the following command.

MariaDB [mysql]> update user SET PASSWORD=PASSWORD('linux') WHERE USER="root";
Query OK, 3 rows affected (0.03 sec)
Rows matched: 3  Changed: 3  Warnings: 0

Update the changes done using the below command

MariaDB [mysql]> flush privileges;
Query OK, 0 rows affected (0.04 sec)

Now,Exit from the MariaDB database

MariaDB [mysql]> exit
Bye

Restart the Service of MariaDB

 [root@linuxhelp ~]# systemctl restart mariadb

Now,Login to the MariaDB database using the new password

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

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

With this,MariaDB root login password has been changed successfully and the article comes to end.

Tags:
benjamin
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What does grant tables contain in MariaDB?

A

Grant Tables contain information about user accounts and the privileges held by them in MariaDB

Q

What are the default databases present in MariaDB?

A

The default databases present in MariaDB are mysql,information_schema and performance_schema.

Q

What is performance_schema in MariaDB?

A

Performance_schema is a feature in MariaDB for monitoring MariaDB server execution at a low level .

Q

What is information_schema in MariaDB?

A

In MariaDB,information_schema provides access to database metadata.

Q

What does mysql contain in MariaDB?

A

MySQL is the system database that contains tables which store information required by the MYSQL server.

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 Luk Van De Looverbosch ?
How to create a root ?

Hello,
How to create root@linuxhelp in Linux Mint 20.1 64-bit ?
Thanks in advance for your reply.
Best regards.

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.