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

Usage of mysql user Management

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

Share

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

This article mainly explains the use of mysql user management, the content is clear, interested friends can learn, I believe it will be helpful after reading.

The content of this article is:

User introduction View user create user account modify account Delete account about Anonymous user

Launch date: 2018-04-19

User introduction: the client connection of mysql is to log in to the server with a user name. The server can change the user's permissions, so each user has different permissions on the database or on the data table. Generally speaking, you should not use the root user to log in because the root user has the highest privileges to perform "dangerous" operations such as deleting the database. For security, you should log in with another user and assign him the appropriate permissions. And the user should have a password, it is very dangerous to use an anonymous user (no password). If this anonymous user is open to remote login, then others can log in to your mysql as long as they detect that your port is open. View users: MySQL user accounts and information are stored in a MySQL database called mysql. The mysql database has a table called user, which contains all user accounts. The user table has a column named user, which stores the user login name.

When using select * from user\ G to get complete table data, the suffix is priv, which means permission, and N means no. Host represents the host that is allowed to log in, and% allows local and non-local hosts to log in. User is the user name and authentication string is the hash of the password.

Create a user account: 1:create user user name @ logon address identified by 'password'; no loggable address represents all addresses can log in if only local login is allowed, it should be set to localhost mode 2:grant permissions on database. Data table to user name @ login address identified by 'password'; method 3: you can use Insert to insert data directly into the user table, but it is not recommended. Modify account: rename user: rename user original user name @ logon address to new user name @ login address [the login address of the original user name is required, but the login address of the new user name is optional, but if it is left empty, the default is%, that is, remote login is allowed] change the password: set password for 'user name' @ login address = password ('password') [in order to change the password of the current user without specifying a user name] [the login address is optional and must be the original login address] modifying account permissions will be described in another blog post. Hyperlink: user rights management of mysql to delete account: drop user user name; add: before mysql5.0, the drop user command will only delete the user, not the permission, which needs to be deleted with revoke before 5.0. About anonymous users: in the old version, there was an anonymous user by default, so you don't need to use a user and password to log in to mysql how to create anonymous users. In general, anonymous users should not be created, even if they are created because it is convenient to learn. After reading the above content, do you have a better understanding of the use of mysql user management? if you want to learn more, 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