Detailed parsing of MySQLgrant syntax bitsCN.com
Detailed parsing of MySQL grant syntax
The following is a detailed explanation of MySQL grant syntax. if you are interested in the actual operations related to MySQL grant syntax, you can click and
Over the past few days, I am tossing the database and recording the permissions that mysqldump wants to use.Grant event, RELOAD, lock tables, SELECT, show view, replication client on *. * TO 'DB _ user_backups '@' % 'identified by 'mwvhyza1yzc1ytm4 '
I. Preparatory workUbuntu1404Two hosts on the same network segment with MySQL installedMySQL version192.168.141.128 MasterMySQL--versionMySQL Ver 14.14 distrib 5.5.46, for Debian-linux-gnu (x86_64) using ReadLine 6.3192.168.141.129
1 syntaxGrant permission 1, permission 2,... Permission n on the database name. Table name to User name @ user address identified by ' connection password ';1.1 PermissionsIf you want to grant all permissions for the user to manipulate the database
MYSQL creates the user, and authorizes, modifies the password.Create a user and grant all permissions to lawCreate user [email protected];Grant all privileges on * * to [e-mail protected] identified by ""; ----OKCreate a local user blank password
Detailed parsing of MySQLgrant syntax (account permission management) bitsCN.com
Detailed parsing of MySQL grant syntax (account permission management)
Record some usage of mysql grant. The simple format of commands for granting user permissions
Statement
The code is as follows
Copy Code
Show grants for your users
Like what:
The code is as follows
Copy Code
Show grants for root@ ' localhost ';
View user rights.
MySQL can assign strict, complex permissions to different users. Most of these operations can be implemented with SQL Directive grant (assigning permissions) and revoke (Reclaim permissions). Grant can assign the specified permissions to a specific
Scenario: I run the Centos,mysql in the virtual machine under the Mac terminal with SSH operation in CentOSMySQL -u root -pAfter logging in to MySQL with RootUseGrant All Privileges on DB1. * to [Email protected] ' % ' by ' User1 ' with Grant
Mysql database permission control grant permission on database object to user password remote users have permissions granted to www.2cto.com grant all privileges on *. * to root @ '%' identified by '000000' with grant option; mysql> grant all on *. *
==========
Root User Password operation (Change User Password)======== For MySQL just installed, only one root user has a blank password and can only log on to the local machine!
Add the password xxx123 to the root user:
./Bin/mysqladmin-u Root
Grant mysqlgrant permissions to bitsCN.com
Mysql grant permission allocation
Change password
1. modify data in the database
Mysql-u root-p Press enter
Enter password
Mysql> user mysql
Mysql> select user, password from user; # View password
Run the "showprivileges;" command to view grant permissions on database objects to users 1. grant normal data users the right to query, insert, update, and delete all table data in the database. Grantselectontestdb. * tocommon_user @ '%'
Grant permissions on database objects to users 1. grant normal data users the right to query, insert, update, and delete all table data in the database. Grantselectontestdb. * tocommon_user @ % grantinsertontestdb. * tocommon_user @ %
Go out security considerations, the default MySQL is to allow only native links, and not allow other hosts to connect through the client tools. To resolve this problem at this point, there are three ways to resolve it.
A, authorized logins to other
Excerpt from: http://renxiangzyq.iteye.com/blog/763837updateERROR 1364 (HY000): Field ‘ssl_cipher‘ doesn‘t have a default value建议使用GRANT语句进行授权,语句如下:grant all privileges on *.* to [email protected]‘%‘ identified by "root";-----------------------------
The MySQL permissions system revolves around two concepts:Authentication, determining whether a user is allowed to connect to a database serverAuthorization, determines whether the user has sufficient permissions to execute the query request, and so
Mysql database permission control bitsCN.com
Mysql database permission control
Grant permission on database object to user password
The remote user has the permission granted.
Grant all privileges on *. * to root @ '%' identified by '000000' with
MySQL User management and permission management show grants for wzhao;
Grant ALL on *. * to 'wzhao' @ '% ';
----------------------------------------------------
GRANT
SELECT
,
INSERT
,
UPDATE
,
DELETE
,
CREATE
,
DROP
, RELOAD, SHUTDOWN,
MySQLStudy-MySQL User and permission management MySQL server uses the MySQL permission table to control user access to the database. the MySQL permission table is stored in the mysql database and initialized by the mysql_install_db script. These
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.