Provides you with an in-depth understanding of MySQL permission management.

Source: Internet
Author: User
Tags mysql connection string mysql index

Different permissions have different operations on the MySQL database. The following describes some knowledge about MySQL permission management. If you are interested in MySQL permission management, take a look.

========= Change the user password for the ROOT user password operation) =========
After the MySQL has just been installed, there is only one root user in MySQL permission management. The password is blank and can only be logged on to the local machine!

Add the password xxx123 to the root user:
./Bin/mysqladmin-u root password xxx123
Or write
./Bin/mysqladmin-uroot password xxx123

After the password is added, enter mysql in this tutorial:
./Bin/mysql-uroot-p

Change the root password from xxx123 to yy1234:
./Bin/mysqladmin-uroot-pxxx123 password yy1234

======= Grant permissions on database objects to users ==============
The simple format of commands granted to users by MySQL is as follows:
Grant permission on database objects to users
Grant permission on database object to user identified by "password"

======= User and permission management: The most common operation instance ==========
(Username: dba1, password: dbapasswd, logon IP: 192.168.0.10)

// Open the permission to manage all databases in MySQL
Grant all on *. * to dba1 @ '192. 168.0.10 'identified by "dbapasswd ";

// Open the permission to manage the specific database testdb in MySQL.
Grant all privileges on testdb to dba1 @ '192. 168.0.10 'identified by "dbapasswd ";
Or
Grant all on testdb to dba1 @ '192. 168.0.10 'identified by "dbapasswd ";

// Open the permission to manage tables (testdb. table1) of a specific MySQL database
Grant all on testdb. teable1 to dba1 @ '192. 168.0.10 'identified by "dbapasswd ";

// Open the permission to manage some columns of a table (testdb. table1) of a specific database in MySQL
Grant select (id, se, rank) on testdb. table1 to ba1 @ '192. 168.0.10 'identified by "dbapasswd ";

// Open management operation commands
Grant select, insert, update, delete on testdb. * to dba1 @ '192. 168.0.10 'identified by "dbapasswd ";

// Revoke permissions
Revoke all on *. * from dba1 @ localhost;

// View MySQL user permissions
Show grants;
Show grants for dba1 @ localhost;
 

The preceding section describes MySQL permission management.

How to optimize mysql Indexes

Mysql index Comparison Analysis

MySQL index usage

Insufficient mysql Indexes

MySql connection string description

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.