In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
I. create a new user
/ / Log in to MYSQL
Root@log:~# mysql-uroot-p
Enter password: password
Welcome to the MySQL monitor. Commands end with; or\ g.
Your MySQL connection id is 138
Server version: 5.5.53-0ubuntu0.14.04.1 (Ubuntu)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.
/ / create a user
Mysql > insert into mysql.user (Host,User,Password) values ("localhost", "zhouyuyao", password ("Zhouyuyao123"))
Mysql > insert into mysql.user (Host,User,Password) values ("%", "zhouyuyao", password ("Zhouyuyao123"))
/ / refresh the system permissions table
Mysql > flush privileges
This creates a user named: zhouyuyao password: Zhouyuyao123.
Second, login test
Mysql > exit
@ > mysql-u zhouyuyao-p
@ > enter your password
Mysql > Login succeeded
III. User authorization
/ / Log in to MYSQL
@ > mysql-u root-p
@ > password
/ / first create a database (test) for the user
Mysql > create database test
/ / authorized zhouyuyao users have all permissions of the test database
Mysql > grant all privileges on test.* to zhouyuyao@'%' identified by 'Zhouyuyao123'
/ / refresh the system permissions table
Mysql > flush privileges
Mysql > other actions
IV. Partial authorization
Mysql > grant select,update on test.* to zhouyuyao@localhost
Identified by 'cplusplus.me'
/ / refresh the system permissions table
Mysql > flush privileges
Delete users
@ > mysql-u root-p
@ > password
Mysql > DELETE FROM user WHERE User= "zhouyuyao" and Host= "localhost"
Mysql > flush privileges
Delete the database
Mysql > drop database test
7. Change the password
@ > mysql-u root-p
@ > password
Mysql > update mysql.user set password=password ('new password') where
User= "zhouyuyao" and Host= "localhost"
Mysql > flush privileges
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.