Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create and authorize users in MySQL 5.7s

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

In this issue, the editor will bring you about how to create and authorize users in MySQL 5.7. the article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

-- create users

Mysql > create user 'test'@'%' identified by' System#2013'

Query OK, 0 rows affected (0.00 sec)

Mysql > select host,user from mysql.user

+-+ +

| | host | user |

+-+ +

| |% | test |

| | localhost | jeffrey |

| | localhost | mysql.sys |

| | localhost | root |

+-+ +

4 rows in set (0.00 sec)

-- Grant operation permissions to the TEST database

Mysql > GRANT ALL ON test.* TO 'test'@'%'

Query OK, 0 rows affected (0.01 sec)

-- testing newly created users

[root@T400-kelong] # mysql-utest-pSystem#2013

Mysql: [Warning] Using a password on the command line interface can be insecure.

Welcome to the MySQL monitor. Commands end with; or\ g.

Your MySQL connection id is 6

Server version: 5.7.10-log MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

Affiliates. Other names may be trademarks of their respective

Owners.

Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.

Mysql > use test

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with-A

Database changed

Mysql > CREATE TABLE client_firms (

-> id INT

> name VARCHAR (35)

->)

-> PARTITION BY LIST (id)

-> PARTITION R0 VALUES IN (1, 5, 9, 13, 17, 21)

-> PARTITION R1 VALUES IN (2,6,10,14,18,22)

-> PARTITION R2 VALUES IN (3, 7, 11, 15, 19, 23)

-> PARTITION R3 VALUES IN (4, 8, 12, 16, 20, 24)

->)

Query OK, 0 rows affected (0.15 sec)

This is how to create and authorize users in MySQL 5.7.If you happen to have similar doubts, please refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report