In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains the "MySQL new users how to authorize, delete users and change passwords", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "MySQL new users how to authorize, delete users and change passwords" bar!
Test environment: WIN32 mysql5.0.45
First of all, let's make it clear: in general, to change the MySQL password and authorization, you need to have the root permission in mysql.
Note: this operation is at the WIN command prompt, phpMyAdmin is also applicable.
User: phplamp user database: phplampDB
1. Create a new user.
/ / Log in to MYSQL
@ > mysql-u root-p
@ > password
/ / create a user
Mysql > insert into mysql.user (Host,User,Password,ssl_cipher,x509_issuer,x509_subject) values ("localhost", "pppadmin", password ("passwd"),')
/ / refresh the system permissions table
Mysql > flush privileges
This creates a user named: phplamp password: 1234.
And log in.
Mysql > exit
@ > mysql-u phplamp-p
@ > enter your password
Mysql > Login succeeded
two。 Authorize the user.
/ / Log in to MYSQL (with ROOT permission). I log in as ROOT.
@ > mysql-u root-p
@ > password
/ / first create a database (phplampDB) for the user
Mysql > create database phplampDB
/ / authorized phplamp users have all permissions in the phplamp database.
> grant all privileges on phplampDB.* to identified by '1234'
/ / refresh the system permissions table
Mysql > flush privileges
Mysql > other actions
/ *
If you want to assign partial permissions to a user, you can write like this:
Mysql > grant select,update on phplampDB.* to identified by '1234'
/ / refresh the system permission table.
Mysql > flush privileges
, /
3. Delete the user.
@ > mysql-u root-p
@ > password
Mysql > DELETE FROM user WHERE User= "lamp" and Host= "localhost"
Mysql > flush privileges
/ / delete the user's
> drop database phplampDB
4. Modifies the specified user password.
@ > mysql-u root-p
@ > password
Mysql > update mysql.user set password=password ('new password') where User= "phplamp" and Host= "localhost"
Mysql > flush privileges
Thank you for your reading, the above is the "MySQL new users how to authorize, delete users and change passwords" content, after the study of this article, I believe you on MySQL new users how to authorize, delete users and change the password of this problem has a deeper understanding, the specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.