In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
It is believed that many inexperienced people do not know what to do about the operation authority in mysql management. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Mysql management: mysql run right (transfer) [@ more@] for a newly installed mysql, its security is very poor, because any user using mysql can use and change the data of the database, so it is necessary to set a password for the root user of mysql (mysql root and linux root are two different things, there is no relationship between them).
The command mysqladmin is needed to set the password for root, because the mysql I installed is under / usr/local, so I go to the directory / usr/local/bin to run this command:
#. / mysqladmin-u root password "passwd"
"passwd" is the plaintext password I set for root
All right, I run mysql under the root user:
# mysql
If rejected, run mysql with the following command:
# mysql-uroot-p
Appears: Enter password:
After I entered my password, I logged in successfully, so I don't have to worry about other users using the database at will, and then there are problems. Root permissions have the right to control everything in mysql. When a user requests to use the database, it is also very dangerous to tell the user the root password, so I consider setting up other user accounts in the database and opening the appropriate permissions to him.
To create new users and authorization, you need to use the following syntax:
Grant privileges on what to user identified by "passwd" with grant option
Privileges assigns permissions
Application level of what permission
User user
Passwd password plaintext
With grant option will allow users to assign their permissions to others when using this clause.
I'm going to create a user of team and only allow him to use the permissions of the team database, so I used the following name command:
# mysql-uroot-ppasswd
Run mysql first
> grant all on team.* to team@localhost identified by "team"
Here I give the team user all the rights to control the team database, and do not allow him to assign permissions to others.
So when a user requests to use the database, I just need to give him the team user's password.
In addition, in the web page to control the mysql database tool phpMyAdmin is a very powerful and dangerous tool, for the security of the database, it is best to use this tool, let the user pass authentication for security.
After reading the above, have you mastered the method of running permissions in mysql management? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.