Got it

The Series of MySQL -3- MySQL User Management - EP 03_02

Latest reply: Feb 25, 2022 06:46:33 564 27 14 0 0

The Series of MySQL -2- MySQL User Management - EP 03_02

 

HI Hi, Greetings!  i_f47.gif 

Happy January i_f25.gif

 

Hi Everyone,

 

Today, I would like to share with you an article about the third episode of Series of MySQL (MySQL User Management), and the content is given below.

 

a. MySQL Create User

b. MySQL Drop User

c. MySQL Show Users

d. MySQL User Password Change 

 

MySQL Drop User

 

We can use the MySQL Drop User statement to delete one or more user accounts from the database server, as well as their rights. It returns an error if the account doesn't exist on the database server.

 

You must have a global privilege of Create User statement or the DROP privilege for the MySQL system schema if you want to utilize the Drop User statement.

 

Sample Scenario:

Delete a user:

 

DROP USER 'account_name';  


The account_name can be identified with the following command:


username@hostname  

 

The username is the account name you want to remove from the database server, and the hostname is the user account's server name.

The steps for drop (delete) a new user in the MySQL server database are as follows.


Step 1: Open the MySQL server by using the mysql client tool.


Step 2: Enter the password for the account and press Enter.

Enter Password: ********  


Step 3: Execute the following command to show all users in the current MySQL server.


mysql> select user from mysql.user;  

                                                

333


Step 4: To drop a user account, you need to execute the following statement.


DROP USER ada@localhost;  

 4444


The username 'ada' will be removed from the MySQL server in the above step. After the above command has been successfully executed, you must run the show user statement once more.

Step 5: You can also use the DROP USER statement to delete many user accounts at once. We can delete several user accounts by using the comma operator to separate account names. Execute the following command to erase numerous user accounts.


DROP USER ada@localhost, pet@localhost;  


The ada and pet accounts will be removed from the above image. After the above command has been successfully executed, you must run the show user statement once more. If the usernames john and peter aren't present, you'll get the following output.


www

 

You are welcome to like and leave feedback in the comment area. 


Link: 


EP 03_01:

The Series of MySQL -3- MySQL User Management - EP 03_01




EP 03_03:

The Series of MySQL -3- MySQL User Management - EP 03_03



EP 03_04:

The Series of MySQL -2- MySQL User Management - EP 03_04


Source: 

·        https://www.w3schools.com/mySQl/default.asp

·        https://www.mysqltutorial.org/mysql-basics/



M M Zaheer Hussain

Stay Safe!

tt


The post is synchronized to: Author groupzaheernew's Author Collection

  • x
  • convention:

fuzi_yao
Admin Created Jan 22, 2022 08:25:20

good!
View more
  • x
  • convention:

Saqib123
Moderator Created Jan 23, 2022 08:53:02

Thanks for sharing.
View more
  • x
  • convention:

Saqib123
Moderator Created Jan 23, 2022 08:53:17

Thanks for sharing.
View more
  • x
  • convention:

zaheernew
MVE Author Created Jan 23, 2022 19:24:53

  • x
  • convention:

BAZ
BAZ Created Jan 27, 2022 19:15:30 (0) (0)
Tag doen  
Unicef
MVE Created Jan 24, 2022 01:23:04

THANKS FRIEND
View more
  • x
  • convention:

Rumana
Created Jan 26, 2022 07:38:10

well explained
View more
  • x
  • convention:

BWGARM
Created Jan 26, 2022 15:20:52

Very clear explanation.
View more
  • x
  • convention:

Saqibaz
Created Jan 26, 2022 15:30:04

Thanks for sharing.
View more
  • x
  • convention:

zaheernew
zaheernew Created Jan 26, 2022 15:50:54 (0) (0)
 
Sara_Obaid
Created Jan 26, 2022 16:20:31

Thanks for sharing.
View more
  • x
  • convention:

12
Back to list

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.
Information Protection Guide
Thanks for using Huawei Enterprise Support Community! We will help you learn how we collect, use, store and share your personal information and the rights you have in accordance with Privacy Policy and User Agreement.