Home  >  Article  >  Database  >  Detailed explanation of permission settings in Mysql

Detailed explanation of permission settings in Mysql

黄舟
黄舟Original
2017-08-09 15:53:521297browse

mysql permission settings, mysql access permissions, mysql highest permissions


##1. As we all know, in mysql There are many permissions, and different permissions can use different functions. Today I will teach you how to obtain the root permission of Mysql, which is the highest permission and can do anything.


2. First use an account without permission to connect to mysql. After success, execute: show databases; then you will find Users without permissions can only see one database, databases such as mysql and test cannot be seen;

Detailed explanation of permission settings in Mysql

Detailed explanation of permission settings in Mysql

3. If phpmyadmin has been installed, open 127.0.0.1/phpmyadmin, find the user in the menu bar, then find the user without permissions, click Edit Permissions;

Detailed explanation of permission settings in Mysql

Detailed explanation of permission settings in Mysql


##4. Jump to the settings page and find For global permissions, check the Select All checkbox and click Execute in the lower right corner. After completion, the user will obtain all permissions of the mysql database;

Detailed explanation of permission settings in Mysql

Detailed explanation of permission settings in Mysql


5. Use the account again to connect to mysql again, and execute after the link is successful. :show databases; You will find that all databases will be displayed, and you can edit them at will using this account;

Detailed explanation of permission settings in Mysql

Detailed explanation of permission settings in Mysql


##6. You can also set it directly on the cmd window command line. The command to set permissions is:

REVOKE ALL PRIVILEGES ON *.* FROM 'root'@'localhost'; 
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost'WITH GRANT OPTION 
MAX_QUERIES_PER_HOUR 0 
MAX_CONNECTIONS_PER_HOUR 0 
MAX_UPDATES_PER_HOUR 0 
MAX_USER_CONNECTIONS 0;

PS: Change the username part according to your actual situation.

The above is the detailed content of Detailed explanation of permission settings in Mysql. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn