Home  >  Article  >  Database  >  What should I do if I need permission to access mysql?

What should I do if I need permission to access mysql?

coldplay.xixi
coldplay.xixiOriginal
2020-10-12 11:43:341963browse

Method to solve the MySQL access permission setting: first enter the mysql execution directory and enter [mysqld-shareware.exe], then enter [mysql --user=root mysql]; then enter [mysql''gt] , operate through the prompt.

What should I do if I need permission to access mysql?

##More related free learning recommendations: mysql tutorial(Video)

Solution to MySQL access permission setting:

Access permission setting method one

Use Grant command to authorize, enter the code as follows:

mysql"gt;GRANT ALL PRIVILEGES ON *.* TO system@localhost
IDENTIFIED BY 'manager' WITH GRANT OPTION;

It should display: Query OK, 0 rows affected (0.38 sec)

Access permission setting method two

Set each permission of the user:

mysql"gt;INSERT INTO user valueS('localhost','system',PASSWORD('manager'), 'Y', 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y ');

For the 3.22.34 version of MySQL, there are a total of 14 ""Y"", and their corresponding permissions are as follows (arranged in field order): Permission table column names corresponding explanation and scope of use

select Select_priv Only requires select permission when retrieving from a table

insert Insert_priv allows you to insert new rows into an existing table table

update Update_priv allows you to update the list of rows in an existing table with new values ​​

delete Delete_priv allows you to delete rows that meet the conditions in the table

create Create_priv allows you to create a new database and table database, table or Index

drop Drop_priv Drops (delete) existing databases and tables Database or table

reload Reload_priv Allows you to tell the server to re-read the authorization table Server Management

shutdown Shutdown_priv may be Abuse (denying service to other users by terminating the server) Server Administration

process Process_priv Allows you to view the plain text of the currently executing query, including setting or changing passwords Query Server Administration

file File_priv Permissions Can be abused to read any readable file on the server into a database table File access on the server

grant Grant_priv allows you to grant the same permissions you have to other users database or table

references References_priv allows you to open and close the record file database or table

index Index_priv allows you to create or discard (delete) the index table

alter Alter_priv allows you to change the table, can be used to pass Rename the table to **permission system table

If you create a user with only select, insert, update, and delete permissions, the user is allowed to perform operations only on existing tables in one database.

Now we can create the database we want to use, we enter it directly. For example: if we want to create a database named XinXiKu, we can use the following code:

mysql"gt;create database XinXiKu;

It should display: Query OK, 1 row affected (0.00 sec)

The above is the detailed content of What should I do if I need permission to access 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