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

Mysql remote login notes

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

A user name is required for non-root

Switch database

Mysql > use mysql

Create a user (user1: user name;%: any ip, or you can specify. Root defaults to localhost;123456: login password)

Mysql > CREATE USER 'user1'@'%' IDENTIFIED BY' 123456'

Authorization, the default user right to create is usage, that is, no permission, can only log in, (all: all permissions, there are select,update and other permissions, you can search; the latter.: specify the database. Specify the table, here is all; to is followed by the user you just created)

Mysql > grant all on. To 'user1'@'%'

Note: a user authorized with the above command cannot authorize another user. If you want that user to be authorized, use the following command:

GRANT all ON databasename.tablename TO 'username'@'host' WITH GRANT OPTION

Mysql >

Mysql > CREATE USER 'admin'@'%' IDENTIFIED BY' 123456'

Query OK, 0 rows affected (0.07 sec)

Mysql > grant all on. To 'user1'@'%'

Mysql >

Mysql > grant all on. To 'admin'@'%'

Query OK, 0 rows affected (0.09 sec)

Https://www.cnblogs.com/xyabk/p/8967990.html

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