Home >Database >Mysql Tutorial >How to check MySQL database system privileges?

How to check MySQL database system privileges?

黄舟
黄舟Original
2017-08-03 09:57:481482browse

How to check the system privileges of MYSQL database? Many friends have incorrect permissions and cannot access when using mysql. In fact, it may be that your mysql does not have remote access permissions and only has localhost access permissions. Now I will demonstrate how to check the MYSQL database system privileges.

How to check MySQL database system privileges?

How to check the MYSQL database system privileges

1. After opening the Windows operating system, click the start menu in the lower left corner, and in the pop-up menu Find the installed mysql, and then click to start mysql, as shown in the figure below.

How to check MySQL database system privileges?

2. Click to open the DOS login box of mysql, enter your mysql password, and then press Enter, as shown in the figure below.

How to check MySQL database system privileges?

3. After entering the correct password and successfully logging in, use the command: use mysql, as shown in the figure below.

This is because mysql permissions are recorded here.

How to check MySQL database system privileges?

4. Enter and press Enter. If database changed appears in the window, the switch has been successful. Now, use the command: show tables to view the tables under mysql, as shown in the figure below.

How to check MySQL database system privileges?

5. After using the show tables command, all tables will be queried. At this time, you can see a user in the last name. This user The table records mysql permissions. As shown below.

How to check MySQL database system privileges?

6. Use the command: select * from user; enter and press Enter, as shown in the figure below.

How to check MySQL database system privileges?

##7.OK, mysql will display the permissions of all users mysql, as shown in the figure below .

How to check MySQL database system privileges?

8. The display as above is messy and it is not easy to check the permissions. At this time we can use the command: desc user, to view the fields of the user table, and then select the ones you need, as shown in the figure below.

How to check MySQL database system privileges?

9. Here we need to check the permissions of mysql, so use the command directly: select user, host form user. You can query the corresponding permissions of the mysql user. As shown below.

How to check MySQL database system privileges?


The above is the detailed content of How to check MySQL database system privileges?. 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