In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article is about how to reset the Root password in MariaDB, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
First, stop the database.
If you are using MySQL, please enter the following command and press enter.
$sudo systemctl stop mysql
For MariaDB:
$sudo systemctl stop mariadb
Next, restart the database without permission checking using the following command:
$sudo mysqld_safe-skip-grant-tables &
Here, the-- skip-grant-tables option allows you to connect without a password and all permissions. If you start the server with this option, it also enables the-- skip-networking option, which prevents other clients from connecting to the database server. Also, the & symbol is used to run commands in the background, so you can enter other commands in the following steps. Please note that the above command is dangerous and your database will become insecure. You should only run this command for a short time to reset the password.
Next, log in to the MySQL/MariaDB server as root:
$mysql
At the mysql > or MariaDB [(none)] > prompt, run the following command to reset the root user password:
UPDATE mysql.user SET Password=PASSWORD ('NEW-PASSWORD') WHERE User='root'
Replace NEW-PASSWORD in the above command with your own password.
Then, enter the following command to exit the mysql console.
FLUSH PRIVILEGES;exit
* to close the database that was previously run with the-- skip-grant-tables option. To do this, run:
$sudo mysqladmin-u root-p shutdown
You will be asked to enter the MySQL/MariaDB user password you set in the previous step.
Now, start the MySQL/MariaDB service normally using the following command:
$sudo systemctl start mysql
For MariaDB:
$sudo systemctl start mariadb
Use the following command to verify that the password has indeed changed:
The above $mysql-u root-p is how to reset the Root password in MariaDB. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.