In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the method of adding user name and password in mysql, which is very detailed and has certain reference value. Friends who are interested must read it!
Add a user name and password to mysql by executing the [insert into mysql.user (Host,User,Password) values ("localhost", "user name", password ("password");) statement.
Reminder:
This operation is done at the WIN command prompt, and phpMyAdmin also applies.
User: phplamp user database: phplampDB
The specific methods are as follows:
1. Create a new user
/ / Log in to MYSQL@ > mysql-u root-p @ > password / / create user mysql > insert into mysql.user (Host,User,Password) values ("localhost", "phplamp", password ("1234")); / / Refresh system permission table mysql > flush privileges
This creates a user named: phplamp password: 1234.
And log in.
Mysql > exit;@ > mysql-u phplamp-p @ > enter password mysql > login succeeded
2. Authorize the user
/ / Log in to MYSQL (with ROOT permission). I log in as ROOT. @ > mysql-u root-p @ > password / / first create a database for the user (phplampDB) mysql > create database phplampDB;// authorizes the phplamp user to have all the permissions of the phplamp database. > grant all privileges on phplampDB.* to phplamp@localhost identified by '1234 scramble / refresh the system permissions table mysql > flush privileges;mysql > other operations / * if you want to assign some permissions to a user, you can write: mysql > grant select,update on phplampDB.* to phplamp@localhost identified by' 1234 permissions / refresh the system permissions table. Mysql > flush privileges;*/
3. Delete a user
@ > mysql-u root-p @ > password mysql > DELETE FROM user WHERE User= "phplamp" and Host= "localhost"; mysql > flush privileges;// delete the user's database mysql > drop database phplampDB
4. Modify the password of the specified user
@ > mysql-u root-p @ > password mysql > update mysql.user set password=password ('new password') where User= "phplamp" and Host= "localhost"; mysql > flush privileges; is all about how to add a user name and password to mysql. Thank you for reading! Hope to share the content to help you, more related knowledge, 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.
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.