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]
| +----
; Conn Username/password Sql> select * from User_sys_privs; We will start with the creation of Oracle User Rights table, then explain the general actions such as landing, so that you have a deep understanding of the Oracle User Rights table. First, create sys;//system Administrator with the highest privileges system;//Local Administrator, sub-high privilege scott;//Normal user, password default is tiger, default unlocked Second, landing Sqlplus/as sysdba;//Login SYS account Sqlplus Sys as sysdba
Label:MySQL used to be not a lot, 2 days to read the MySQL must know will also review the foundation. The 200-page book will soon be finished,Most of the knowledge is relatively basic, but still understand some previously unknown knowledge points. Make a backup of yourself and view it at any time.Command:SQL is case-insensitive, statement uppercase, column, table name lowercase is a habitConnection command: Mysql-u user_name–h example.mysql.alibabalabs.com–p3306–pxxxxQuitHelp show; View all Show
default tablespace user which tablespace to use;To modify a user's permissions:Grant role 1, role 2 to user name;Examples are as follows:Create user wbppcs identified by wbppcs123 default Tablespace wbppcs;Grant DBA, connect to Wbppcs;V. Granting of rights1, the default ordinary user Scott is not unlocked by default, cannot do that use, the new user does not have any permissions, must be granted permissions/* Administrator Authorization */Grant Create session to zhangsan;//Grant Zhangsan user p
This article describes how the query memory grant, which works on SQL Server, applies to SQL 2005 through 2008. Query Memory Grants (hereinafter abbreviated as QMG) are used to store temporary intermediate data rows when data is sorted and concatenated. A query needs to reserve memory before it is actually executed, so there is a grant action. The benefit of this is to improve the reliability of the query and avoid consuming all of the memory for a si
protected] identified by ' passwd ' authorization command corresponding permissions (all permissions) target: libraries and tables Account name and client host user password5. To refresh the permissions after the authorization is complete:Flush privileges;6. View created Users:Select Host,user from Mysql.user;7. View permissions to create a user: show grants for [email protected];#USAGE indicates that the user can only log on, no other permissions, t
be granted permissions Grant Create session to zhangsan;//Grant Zhangsan user permission to create session, that is, login permission Grant Unlimited tablespace to zhangsan;//grants Zhangsan users permission to use tablespaces Grant CREATE table to zhangsan;//grants permissions for creating tables Grante drop table to zhangsan;//grant permission to delete tables Grant Insert table to zhangsan;//permissi
Create session to zhangsan;//Grant Zhangsan user permission to create session, that is, login permissionGrant Unlimited session to zhangsan;//grants Zhangsan user 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 tab
be granted permissions GRANTCreate SESSION, create any TABLE, create any VIEW, create any INDEX, create any PROCEDURE,Alter Session,alter any TABLE, alter all INDEX, alter any PROCEDURE,Drop any TABLE, drop no VIEW, drop any INDEX, drop any PROCEDURE,Select any TABLE, select any SEQUENCE,INSERT any table, UPDATE any table, DELETE any tableto username; Grant Create session to zhangsan;//Grant Zhangsan user permission to create session, that is, login permission Grant Unlimited tablespace to zhan
be granted permissions Grant Create session to zhangsan;//Grant Zhangsan user permission to create session, that is, login permission Grant Unlimited tablespace to zhangsan;//grants Zhangsan users permission to use tablespaces Grant CREATE table to zhangsan;//grants permissions for creating tables Grante drop table to zhangsan;//grant permission to delete tables Grant Insert table to zhangsan;//permissions
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.