In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will introduce in detail "mysql how to modify users", the content steps are clear and detailed, the details are handled properly, and the editor updates different knowledge points every day, I hope this article "how to modify users in mysql" can give you unexpected gains, please follow the editor's ideas slowly in depth, the specific content is as follows, together to harvest new knowledge.
Methods: 1, use "RENAME USER" statement to modify user name, syntax is "RENAME USER old user name TO new user name"; 2, use "SET PASSWORD" statement to modify user password, syntax is "SET PASSWORD=PASSWORD (new user password)".
The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.
How mysql modifies users
Modify user account
You can use the RENAME USER statement to modify one or more existing MySQL user accounts.
Syntax format:
RENAME USER TO
The syntax is as follows:
MySQL user account that already exists in the system.
: new MySQL user account.
You should be aware of the following when using RENAME USER statements:
The RENAME USER statement is used to rename the original MySQL account.
If the old account does not exist in the system or the new account already exists, an error will occur during the execution of the statement.
To use the RENAME USER statement, you must have UPDATE permissions or global CREATE USER permissions for the MySQL database in MySQL.
Use the RENAME USER statement to change the user name james to jack and the host to localhost. The SQL statement entered and the execution procedure are shown below.
Mysql > RENAME USER james@'localhost'-> TO jack@'localhost';Query OK, 0 rows affected (0.03 sec)
In the Windows command line tool, log in to the database server using jack and password tiger, as shown below.
C:\ Users\ USER > mysql-h localhost-u jack-pEnter password: * Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 7Server version: 5.7.20-log MySQL Community Server (GPL) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.
You can use the SET PASSWORD statement to change a user's login password.
[test_user_new2] is the new password
Set password=password ('test_user_new2')
Thank you for reading this. The editor hopes that you have the most profound experience on the key issue of "how to modify users of mysql" from the practical level, and you still need to practice and use it yourself to understand it. If you want to read more related articles, welcome to 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.