privileges ON databasename. tablename TO 'username' @ 'host'
mysql> grant select,delete,create,insert,update on aa.* to 'cai'@'localhost';Query OK, 0 rows affected (0.00 sec)mysql> show grants for cai@localhost;+-----------------------------------------------------------------------------+| Grants for cai@localhost |+---------------------------------------
create user 'test' @ '192. 168.2.2
Permission management
To authorize an account, you must use the Grant statement. if the account already exists, Grant the statement to authorize it. if the account does not exist, create the Grant statement first, and then authorize it.
You can use the show grants statement to obtain your own permissions:
[sql] mysql> show grants; +-------------------------------
that in ASP. net accesses the database as an ASP net virtual user. We need to grant this account specific NTFS permissions to Make ASP.. Net program runs normally.
To get the strictest NTFS permission settings, we will give the program the lowest NTFS permission at the beginning of the experiment:
A) D: The/wwwroot/test/data/folder grants the user ASPnet the following permissions:Reject allowedFull Control □□Modify □□Read and run √ □List folder direc
can use the show grants statement to obtain your own permissions:
Mysql> show grants;+ Certificate --------- +| Grants for root @ localhost |+ Certificate --------- +| Grant all privileges on *. * TO 'root' @ 'localhost' identified by password' * 578EC7851088AC1F2A67B100540344B03BD2BA99 'with grant option |+ Certificate --------- +
You can also use show
hitest;Mysql> select * from test;+----+--------+| ID | name |+----+--------+| 1 | Zy || 2 | Binghe || 3 | doit |+----+--------+Mysql> Show grants for byrd@ ' 192.168.199.% ';+-------------------------------------------------------------------------------------------------------------- -----------------------------------------------+| Grants for byrd@192.168.199.% |+-----------------------------------------
Tags: nts int permissions nbsp Sele copy cal use backGrant all on * * to ' user1 ' identified by ' passwd ' Grant Select,update,insert on db1.* to ' user2 ' @ ' 192.168.133.1 ' identified by ' passwd '; Grant all on db1.* to ' user3 ' @ '% ' of ' identified by ' passwd '; Show grants; Show grants for [email protected]; 1.grant all on * * to ' user1 ' @127.0.0.1 ' identified by ' 123456 '; Authorized to use
, sub-high privilege scott;//Normal user, password default is tiger, default unlocked Second, landing Sqlplus/as sysdba;//Login SYS account Sqlplus Sys as sysdba;//ibid. Sqlplus scott/tiger;//Landing Ordinary user Scott Third, manage users Create user zhangsan;//under the Administrator account, creating the users Zhangsan Alert user Scott identified by tiger;//change password Four, grant permissions 1, the default ordinary user Scott is not unlocked by default, cannot do that use, the new user d
' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement. Mysql>3. View User AuthorizationMysql> Show grants//view current user authorization, +-------------------------------------------------------------------------------------------------------------- --------------------------+
|
-authorize the User1 User:Mysql> Grant all on . to ' user1 ' @ ' localhost ' identified by ' 123456 ';To exit the root user, log in using the User1 User:[Email protected] ~]# mysql-uuser1-pEnter Password:Welcome to the MySQL Monitor. Commands End With; or \g......Mysql>Because the specified login host is localhost, the user uses the local mysql.socket file by default (listening) and does not need to specify an IP to log on.
For specific permission authorizations使用root用户登录:
mysql> grant SELECT,
Create session to zhangsan;//Grant Zhangsan user permission to create session, that is, login permissionGrant Unlimited tablespace to zhangsan;//grants Zhangsan users permission to use tablespacesGrant CREATE table to zhangsan;//grants permissions for creating tablesGrante drop table to zhangsan;//grant permission to delete tablesGrant Insert table to zhangsan;//permissions for inserting tablesGrant Update
, there are a lot of search results about the 1045 error. It seems that it does not matter. Then I shut down MySQL, deleted the data directory, and re-created the database, so it was okay, but the cause of the problem was not found.Look at other people's posts and add a with grant option when adding users. I think it is because this is not added, so users cannot be created. So I checked the statement for creating root @ localhost:Mysql> show grants fo
block.Create user 'test' @ '192. 192.% 'identified '***';You can also use the IP mask.Create user 'test' @ '192. 168.2.2
Permission management
To authorize an account, you must use the Grant statement. If the account already exists, Grant the statement to authorize it. If the account does not exist, create the Grant statement first, and then authorize it.
You can use the show grants statement to obtain your own permissions:
Mysql> show
think it is because this is not added, so users cannot be created. So I checked the statement for creating root @ localhost:Mysql> show grants for root @ localhost;+ --------------------------------------------------------------------- +| Grants for root @ localhost |+ --------------------------------------------------------------------- +| Grant all privileges on *. * TO 'root' @ '2017. 0.0.1 'with grant
'123';Query OK, 0rows affected (0.00 sec)
Log in from another machine
[root@brucetest7 ~]# mysql -ubruce -p -h10.20.0.231Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g.Your MySQL connection id is 5Server version: 5.5.20-log MySQL Community Server (GPL)This software comes with ABSOLUTELY NO WARRANTY. This is free software,and you are welcome tomodify and redistribute it under the GPL v2 licenseType 'help;' or '\h' for help. Type'\c'to clear the current inputstatement.
. Create a database
# UTF-8 encoded create database name default charset utf8 COLLATE utf8_general_ci; # gbk encoded create database name default character set gbk COLLATE gbk_chinese_ci;3. Use a database
USE db_name; # Do not USE semicolons4. User Management
# Create user 'username' @ 'IP address' identified by 'Password'; # delete user drop user 'username' @ 'IP address '; # modify the user rename user 'username' @ 'IP address'; to 'new username' @ 'IP address ';; # change the password set Pas
To prevent users from inserting from the library, use the Read-only parameter:
Configuration:
[Root@slave-mysql data]# grep read-only/etc/my.cnfread-only
Test process:
Master Library Licensing All
Mysql> Grant all on *.* to ' imbyrd ' @ ' localhost ' identified by ' admin ';
Test from library:
[Root@slave-mysql data]#/usr/local/mysql/bin/mysql-uimbyrd-p ' admin 'mysql> use hitest;mysql> INSERT INTO Test (id,name) VALUES (' fo ');Query OK, 1 row affected (0.14 sec)
Master Library Authoriz
Access 1, public
The Public keyword grants a common access permission to one or more declared programming elements. There are no restrictions on the accessibility of public elements.
The Public keyword is used in the following context:
Class Statement Const Statement Declare Statement Delegate Statement DIM Statement Enum Statement Event Statement Function Statement Interface Statement Module Statement Property Statement Structure Statement Sub state
clear the current inPut statement. Mysql> 3. View User Authorization Mysql> Show grants//view current user authorization, +-------------------------------------------------------------------------------------------------------------- --------------------------+
| Grants for [emailprotected]
| +----
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.