当前位置:网站首页>MySQL project 8 summary

MySQL project 8 summary

2022-06-26 10:21:00 m0_ sixty-one million nine hundred and sixty-one thousand eight

Add database users
CREATE USER ‘username’@‘host’ IDENTIFIED BY ‘password’;

username – The user name description you will create :

host – Specifies on which host the user can log in , If available to local users localhost, Such as If you want this user to be able to log in from any remote host , You can use wildcards %

password – The login password of the user , The password can be null , If it is blank, the user can log in without a password Land server

To give 、 Reclaim database user permissions
to grant authorization
GRANT privileges ON databasename.tablename TO ‘username’@‘host’;
privileges – User action permissions , Such as SELECT , INSERT , UPDATE etc. ( See the end of the article for a detailed list ). If you want to grant Permission to use ALL explain :

databasename – Database name

tablename- Table name , Available if you want to grant the user access to all databases and tables * Express , Such as *.*
Users authorized by the above command cannot authorize other users , If you want the user to be authorized , Use the following command

GRANT privileges ON databasename.tablename TO ‘username’@‘host’ WITH
GRANT OPTION;

Set and change user passwords

SET PASSWORD FOR ‘username’@‘host’ = PASSWORD(‘newpassword’);

If it is the current login user

SET PASSWORD = PASSWORD(“newpassword”);

原网站

版权声明
本文为[m0_ sixty-one million nine hundred and sixty-one thousand eight]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206260930071464.html